X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FLexCore.hs;h=7be074a25dea49d82b3fd456f5ccb36e866663be;hb=b88025eabcd83f65d1d81f09272f5172f06a60e7;hp=1a545a3e43b79d2998197b031094b5dcb303d540;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/parser/LexCore.hs b/compiler/parser/LexCore.hs index 1a545a3..7be074a 100644 --- a/compiler/parser/LexCore.hs +++ b/compiler/parser/LexCore.hs @@ -5,7 +5,8 @@ import Ratio import Char import qualified Numeric( readFloat, readDec ) -isNameChar c = isAlpha c || isDigit c || (c == '_') || (c == '\'') +isNameChar c = isAlpha c || isDigit c || (c == '_') || (c == '\'') + || (c == ':') || (c == '$') isKeywordChar c = isAlpha c || (c == '_') lexer :: (Token -> P a) -> P a @@ -35,6 +36,10 @@ lexer cont ('\\':cs) = cont TKlambda cs lexer cont ('@':cs) = cont TKat cs lexer cont ('?':cs) = cont TKquestion cs lexer cont (';':cs) = cont TKsemicolon cs +-- 20060420 GHC spits out constructors with colon in them nowadays. jds +lexer cont (':':cs) = lexName cont TKcname (':':cs) +-- 20060420 Likewise does it create identifiers starting with dollar. jds +lexer cont ('$':cs) = lexName cont TKname ('$':cs) lexer cont (c:cs) = failP "invalid character" [c] @@ -86,7 +91,7 @@ lexKeyword cont cs = ("in",rest) -> cont TKin rest ("case",rest) -> cont TKcase rest ("of",rest) -> cont TKof rest - ("coerce",rest) -> cont TKcoerce rest + ("cast",rest) -> cont TKcast rest ("note",rest) -> cont TKnote rest ("external",rest) -> cont TKexternal rest ("_",rest) -> cont TKwild rest