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
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]
("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