summaryrefslogtreecommitdiff
path: root/parser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'parser.hs')
-rw-r--r--parser.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/parser.hs b/parser.hs
index 3ba5e18..6e8b828 100644
--- a/parser.hs
+++ b/parser.hs
@@ -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