summaryrefslogtreecommitdiff
path: root/compiler/parser/LexCore.hs
diff options
context:
space:
mode:
authorJosef Svenningsson <josef.svenningsson@gmail.com>2006-04-20 22:26:25 +0000
committerJosef Svenningsson <josef.svenningsson@gmail.com>2006-04-20 22:26:25 +0000
commita7515ed727fc7e50ad9a59864f20cb4ddc93fb20 (patch)
tree6776d2af6d643fde144cd9656142209ebdb4ea58 /compiler/parser/LexCore.hs
parent4db2c92cedd11b90c6cec46c245b3b618f734d49 (diff)
downloadhaskell-a7515ed727fc7e50ad9a59864f20cb4ddc93fb20.tar.gz
Fixing some lexer errors with extcore
Diffstat (limited to 'compiler/parser/LexCore.hs')
-rw-r--r--compiler/parser/LexCore.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/parser/LexCore.hs b/compiler/parser/LexCore.hs
index 1a545a3e43..32ea6a8395 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]