summaryrefslogtreecommitdiff
path: root/parser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'parser.hs')
-rw-r--r--parser.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/parser.hs b/parser.hs
index 942c63c..40da1ca 100644
--- a/parser.hs
+++ b/parser.hs
@@ -111,7 +111,13 @@ pExCast = do
return $ ExCast t e
pExLit :: Parser Expression
-pExLit = (exLit_ <$> pLiteral) <|> pParenExpr
+pExLit = do
+ litex <- (exLit_ <$> pLiteral) <|> pParenExpr
+ option litex $ do
+ symbol "["
+ arg <- pExpression
+ symbol "]"
+ return $ exBinOp_ Index litex arg
pParenExpr :: Parser Expression
pParenExpr = do