summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone (parasomnia chroot) <dsilvers@digital-scurf.org>2013-03-14 22:12:31 +0000
committerDaniel Silverstone (parasomnia chroot) <dsilvers@digital-scurf.org>2013-03-14 22:12:31 +0000
commit4de90c6716c176d0eef991b972a39231befcd058 (patch)
tree7277ee054130dbe12a3b0446a1bc997fb88ec77f
parent05ef8ac17d96968c4e86196336881ba710fbc838 (diff)
downloadcalculator-4de90c6716c176d0eef991b972a39231befcd058.tar.bz2
reserved names bugfix
-rw-r--r--calculator.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/calculator.hs b/calculator.hs
index 767845d..795cdf2 100644
--- a/calculator.hs
+++ b/calculator.hs
@@ -27,8 +27,9 @@ data Statement = PrintStatement Expression
deriving (Show)
lexer :: TokenParser ()
-lexer = makeTokenParser (javaStyle { opStart = oneOf "+-*/%"
- , opLetter = oneOf "+-*/%" })
+lexer = makeTokenParser (javaStyle { opStart = oneOf "+-*/%|&=!<>"
+ , opLetter = oneOf "+-*/%|&=!<>"
+ , reservedNames = ["let", "def", "print"]})
parseNumber :: Parser Expression
parseNumber = do