(',', CommaToken), (':', ColonToken), (';', SColonToken),
('.', DotToken), ('+', PlusToken), ('*', StarToken), ('/', SlashToken),
('%', PercentToken), ('=', AssignmentToken), ('<', LesserToken),
- ('>', BiggerToken), ('!', ExclamationToken)]
+ ('>', BiggerToken), ('!', ExclamationToken), ('-', DashToken)]
EscapeMap :: Map Char Char
EscapeMap = fromList [('a', toChar 7), ('b', '\b'), ('f', '\f'), ('n', '\n'),
lex ['\'':'\\':x:'\'':xs] = case get x EscapeMap of
Just t = ret (CharToken t) xs
_ = err ("Unknown escape: \\" +++ toString x)
-lex ['-':t=:[x:xs]]
-| isDigit x = let (n, r) = span isDigit t in
- ret (NumberToken (toInt $ toString ['-':n])) r
-| otherwise = ret DashToken t
lex t=:[x:xs] = case get x SingleCharTokens of
(Just tok) = ret tok xs
Nothing