integer: , -2
, 42
float: 3.14
, 2.71
, 0.0
float :: Parser Double
float = Tok.float lexer
And several tokens which enclose other token(s) returning a compose expression.
parens :: Parser a -> Parser a
semiSep :: Parser a -> Parser [a]
semiSep = Tok.semiSep lexer
commaSep = Tok.commaSep lexer
Lastly our lexer requires that several tokens be reserved and not used as identifiers, we reference these as separately.
reservedOp: +
, *
, -
, ;
reservedOp :: String -> Parser ()
Putting it all together we have our Lexer.hs
module.