diff options
Diffstat (limited to 'parser.hs')
-rw-r--r-- | parser.hs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |