Commit 1e35ba26 by Zachary Snow

allow repeat shorthand in patterns

parent fea5ff44
...@@ -1175,7 +1175,11 @@ PatternNamedItem :: { (Identifier, Expr) } ...@@ -1175,7 +1175,11 @@ PatternNamedItem :: { (Identifier, Expr) }
: Identifier ":" Expr { ($1, $3) } : Identifier ":" Expr { ($1, $3) }
| "default" ":" Expr { (tokenString $1, $3) } | "default" ":" Expr { (tokenString $1, $3) }
PatternUnnamedItems :: { [Expr] } PatternUnnamedItems :: { [Expr] }
: Exprs { $1 } : PatternUnnamedItem { [$1] }
| PatternUnnamedItems "," PatternUnnamedItem { $1 ++ [$3] }
PatternUnnamedItem :: { Expr }
: Expr { $1 }
| Expr Concat { Repeat $1 $2 }
Concat :: { [Expr] } Concat :: { [Expr] }
: "{" Exprs "}" { $2 } : "{" Exprs "}" { $2 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment