From a06c34b552e17cc1c94f41bbb95516398fb79192 Mon Sep 17 00:00:00 2001 From: simonm <unknown> Date: Wed, 17 Dec 1997 13:14:21 +0000 Subject: [PATCH] [project @ 1997-12-17 13:14:21 by simonm] * 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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ghc/compiler/reader/Lex.lhs b/ghc/compiler/reader/Lex.lhs index a634f5028962..cc3c8d84ad8f 100644 --- a/ghc/compiler/reader/Lex.lhs +++ b/ghc/compiler/reader/Lex.lhs @@ -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) ] -- GitLab