diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-02-03 16:30:40 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-02-03 16:30:40 +0100 |
commit | e72a2b8e778fff230848769643a125ae995fbe58 (patch) | |
tree | 23c2aa9b0640b5c2cf57f7e035d5cb6ae33b8e19 /parser.hs | |
parent | 8eb3171845497a1d6025a3f59c09048d1975cd12 (diff) |
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 |