diff options
Diffstat (limited to 'parser.hs')
-rw-r--r-- | parser.hs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -112,9 +112,14 @@ pParenExpr = do return e pLiteral :: Parser Literal -pLiteral = (LitFloat <$> pFloat) <|> (LitInt <$> pInteger) <|> (LitInt <$> pCharStr) +pLiteral = (LitFloat <$> pFloat) <|> pLitInt <|> (LitInt <$> pCharStr) <|> (LitString <$> pString) <|> try pLitCall <|> (LitVar <$> pName) +pLitInt :: Parser Literal +pLitInt = do + i <- pInteger + liftM (maybe (LitInt i) (const $ LitUInt i)) $ optionMaybe (symbol "U") + pLitCall :: Parser Literal pLitCall = do n <- pName |