summaryrefslogtreecommitdiff
path: root/src/SPL/Lex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SPL/Lex.hs')
-rw-r--r--src/SPL/Lex.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/SPL/Lex.hs b/src/SPL/Lex.hs
index 21b8a82..b8f09e3 100644
--- a/src/SPL/Lex.hs
+++ b/src/SPL/Lex.hs
@@ -30,6 +30,7 @@ data Token
| TArrow
| TIf
+ | TElse
| TWhile
| TReturn
| TVar
@@ -107,6 +108,7 @@ lex s = (comment s <|> item s <|> int s <|> char s <|> bool s <|> ident s) >>=
item :: (Alternative m) => String -> m (Token, String)
item ('i':'f':s) = noIdentifier TIf s
+ item ('e':'l':'s':'e':s) = noIdentifier TElse s
item ('w':'h':'i':'l':'e':s) = noIdentifier TWhile s
item ('r':'e':'t':'u':'r':'n':s) = noIdentifier TReturn s
item ('v':'a':'r':s) = noIdentifier TVar s