[project @ 1997-12-17 13:14:21 by simonm]
authorsimonm <unknown>
Wed, 17 Dec 1997 13:14:21 +0000 (13:14 +0000)
committersimonm <unknown>
Wed, 17 Dec 1997 13:14:21 +0000 (13:14 +0000)
* remove explicit lexing of '::' which didn't take into account tokens
  that begin with '::'.
* remove duplicate ':' case from is_sym.
* add '::' as a builtin identifier, mapped to ITdcolon.

ghc/compiler/reader/Lex.lhs

index a634f50..cc3c8d8 100644 (file)
@@ -289,9 +289,6 @@ lexIface cont buf =
         _    -> cont ITobrack (stepOn buf)
     ']'# -> cont ITcbrack (stepOn buf)
     ','# -> cont ITcomma  (stepOn buf)
-    ':'# -> case lookAhead# buf 1# of
-              ':'# -> cont ITdcolon (stepOnBy# buf 2#)
-              _    -> lex_id cont (incLexeme buf)
     ';'#  -> cont ITsemi (stepOn buf)
     '\"'# -> case untilEndOfString# (stepOn buf) of
              buf' ->
@@ -572,10 +569,10 @@ is_id_char (C# c#) =
 
 --OLD: is_id_char c@(C# c#)  = isAlphanum c || is_sym c#
 
-is_sym c#=
+is_sym c# =
  case c# of {
    ':'# -> True; '_'#  -> True; '\''# -> True; '!'# -> True; 
-   '#'# -> True; '$'#  -> True; ':'#  -> True; '%'# -> True; 
+   '#'# -> True; '$'#  -> True; '%'# -> True; 
    '&'# -> True; '*'#  -> True; '+'#  -> True; '.'# -> True; 
    '/'# -> True; '<'#  -> True; '='#  -> True; '>'# -> True; 
    '?'# -> True; '\\'# -> True; '^'#  -> True; '|'# -> True; 
@@ -830,6 +827,7 @@ haskellKeywordsFM = listToUFM $
        ,("!",                  ITbang)
        ,("=>",                 ITdarrow)
        ,("=",                  ITequal)
+       ,("::",                 ITdcolon)
        ]