[generate master table of primitive names, use it everywhere, make allCTypes contain more than just the string names of types
John Meacham <john@repetae.net>**20060425082524] hunk ./DataConstructors.hs 219
-primitiveTable = concatMap f allCTypes ++ map g (snub $ map ( \ (_,b,_) -> b) allCTypes) where
+primitiveTable = concatMap f allCTypes ++ map g (snub $ map ( \ (_,_,_,b,_) -> b) allCTypes) where
hunk ./DataConstructors.hs 230
-    f (x,y,z) | z /= "void" = [typeCons,dataCons] where
+    f (dc,tc,rt,y,z) | z /= "void" = [typeCons,dataCons] where
hunk ./DataConstructors.hs 253
-        rt = ELit (LitCons rn [] eHash)
-        dc = parseName DataConstructor x
-        tc = parseName TypeConstructor x
hunk ./DataConstructors.hs 302
-    ELit (LitCons c [] _) | Just pt <- Map.lookup c ctypeMap -> return (c,pt)
+    ELit (LitCons c [] _)
+        | c == tc_Unit -> return (c,"void")
+        | c == tc_World__ -> return (c,"void")
+        | Just pt <- Map.lookup c ctypeMap -> return (c,pt)
+
hunk ./E/FromHs.hs 765
-        Just Constructor { conAlias = alias } = getConstructor n dataTable
+        Identity Constructor { conAlias = alias } = getConstructor n dataTable
hunk ./E/PrimOpt.hs 50
-rawMap = Map.fromList [ (rawType w,toAtom t) | (_,w,t) <- allCTypes]
+rawMap = Map.fromList [ (rawType w,toAtom t) | (_,_,_,w,t) <- allCTypes]
hunk ./Grin/FromE.hs 218
-    ] ++ [ (toAtom ('C':x), ([Ty $ toAtom y],TyNode)) | (x,y,_) <- allCTypes, y /= "void" ]
+    ] ++ [ (toAtom ('C':show dc), ([Ty $ toAtom y],TyNode)) | (dc,tc,_,y,_) <- allCTypes, y /= "void" ]
hunk ./Name/Names.hs 10
-module Name.Names where
+module Name.Names(module Name.Names,module Name.Prim) where
hunk ./Name/Names.hs 16
+import Name.Prim
hunk ./Name/Names.hs 62
-dc_Addr = toName DataConstructor ("Jhc.Addr","Addr")
-dc_Char = toName DataConstructor ("Prelude","Char")
hunk ./Name/Names.hs 65
-dc_Integer = toName DataConstructor ("Prelude","Integer")
-dc_Int = toName DataConstructor ("Prelude","Int")
hunk ./Name/Names.hs 81
-tc_Char = toName TypeConstructor ("Prelude","Char")
-tc_Double = toName TypeConstructor ("Prelude","Double")
-tc_Integer = toName TypeConstructor ("Prelude","Integer")
-tc_Int = toName TypeConstructor ("Prelude","Int")
hunk ./Name/Names.hs 86
-rt_int = toName RawType "int"
-rt_uint32_t = toName RawType "uint32_t"
-rt_intmax_t = toName RawType "intmax_t"
-rt_HsChar   = toName RawType "HsChar"
-rt_HsPtr    = toName RawType "HsPtr"
-rt_HsFunPtr = toName RawType "HsFunPtr"
hunk ./data/PrimitiveOperators-in.hs 33
-ctypeMap = Map.fromList [ (parseName TypeConstructor n,v) | (n,v,_) <- allCTypes ]
+ctypeMap = Map.fromList [ (tc,v) | (_,tc,_,v,_) <- allCTypes ]
hunk ./data/PrimitiveOperators-in.hs 84
-    rebox x = ELit (LitCons d_Prelude_Int [x] t)
+    rebox x = ELit (LitCons dc_Int [x] t)
hunk ./utils/op_names.prl 39
+    print "{-# NOINLINE tc_$sname #-}\n";
hunk ./utils/op_names.prl 41
+    print "{-# NOINLINE dc_$sname #-}\n";
hunk ./utils/op_names.prl 49
+    print "{-# NOINLINE rt_$rt #-}\n";
hunk ./utils/op_process.prl 70
-    my $v = "$n = ELit (LitCons (parseName TypeConstructor \"$_[0]\") [] eStar)";
+    my $x = $_[0];
+    $x =~ s/^.*\.//;
+    my $v = "$n = ELit (LitCons tc_$x [] eStar)";
hunk ./utils/op_process.prl 80
-    my $n = $_[0];
-    $n =~ s/\W/_/g;
-    $n = "r_" . $n;
-    my $v = "$n = rawType \"$_[0]\"";
+    my $c = $_[0];
+    $c =~ s/\W/_/g;
+    my $n = "r_" . $c;
+    my $v = "$n " . " "x(14-length $n) . "= ELit (LitCons rt_$c  [] eHash)";
hunk ./utils/op_process.prl 90
-    return $dcon{$_[0]}[0] if $dcon{$_[0]};
-    my $n = $_[0];
-    $n =~ s/\W/_/g;
-    $n = "d_" . $n;
-    my $v = "$n = parseName DataConstructor \"$_[0]\"";
-    $dcon{$_[0]} = [$n,$v];
-    return $n;
+    my $x = $_[0];
+    $x =~ s/^.*\.//;
+    return "dc_$x";
hunk ./utils/op_process.prl 112
-    my $v = "$n = TCon (Tycon (toTypeName \"$_[0]\") Star)";
+    my $x = $_[0];
+    $x =~ s/^.*\.//;
+    my $v = "$n = TCon (Tycon tc_$x Star)";
hunk ./utils/op_process.prl 160
-    push @names, "(\"$d->[0]\", \"$d->[1]\", \"$d->[2]\")\n";
+    #push @names, "(\"$d->[0]\", \"$d->[1]\", \"$d->[2]\")\n";
+    my $sname = $d->[0];
+    $sname =~ s/^.*\.//;
+    push @names, "(dc_$sname, tc_$sname, " . rtype($d->[1]) . ", \"$d->[1]\", \"$d->[2]\")\n";
hunk ./utils/op_process.prl 196
-push @names, "(\"Prelude.()\",\"void\",\"void\")";
-push @names, "(\"Jhc.IO.World__\",\"void\",\"void\")";
+#push @names, "(dc_Unit, tc_Unit, undefined,\"void\",\"void\")\n";
+#push @names, "(undefined, tc_World__, undefined,\"void\",\"void\")\n";
+#push @names, "(\"Jhc.IO.World__\",\"void\",\"void\")";
hunk ./utils/op_process.prl 204
+print join("\n",map { "{-# NOINLINE $_->[0] #-}" } values %hsname) . "\n\n";