add list expressions

This commit is contained in:
darkf 2013-10-19 02:09:44 -07:00
parent 16c882b501
commit b55d0befaa
1 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,12 @@ block = do
reserved "end"
return $ Block lst
listSeq p cons = do
symbol "["
lst <- sepBy p (symbol ",")
symbol "]"
return $ cons lst
intPattern = fmap IntP integer
varPattern = fmap VarP identifier
@ -85,6 +91,7 @@ term = try block
<|> try funDef
<|> try call
<|> parens exprparser
<|> listSeq exprparser ListConst
<|> fmap Var identifier
<|> fmap IntConst integer