[project @ 1998-02-25 19:17:19 by sof]
[ghc-hetmet.git] / ghc / compiler / parser / id.c
index 9fac62b..053dc44 100644 (file)
@@ -54,7 +54,7 @@ installHstring(length, s)
   str->len = length;
 
   if (length == 0) {
-     str->bytes = NULL;
+     str->bytes = "";
 
   } else {
      p = xmalloc(length);
@@ -273,16 +273,32 @@ qid_to_pmod(q)
   return mod;
 }
 
+/* Darkly mysterious function used to construct "special-syntax"
+   identifiers.  These mean their prelude versions regardless of
+   context, which is why they are distinguished.  
+
+   We build a gid node (rather than a qual or non-qual name node;
+   look at qid.ugn) with a key (number) and a string.  Here's the 
+   deal
+
+       key
+
+       ARROWCON   function arrow ->
+       LISTCON    list type constructor [], or the empty list []
+       UNITCON    unit type constructor (), or the unity value ()
+       n          n-tuple type constructor (,,,)
+*/
+               
 qid
 creategid(i)
   long i;
 {
   switch(i) {
-    case -2:
-      return(mkgid(i,install_literal("(->)")));
-    case -1:
+    case ARROWGID:
+      return(mkgid(i,install_literal("->")));
+    case NILGID:
       return(mkgid(i,install_literal("[]")));
-    case  0:
+    case UNITGID:
       return(mkgid(i,install_literal("()")));
     default:
       {