allow repeat shorthand in patterns

This commit is contained in:
Zachary Snow 2019-10-11 22:54:21 -04:00
parent fea5ff44eb
commit 1e35ba269d
1 changed files with 5 additions and 1 deletions

View File

@ -1175,7 +1175,11 @@ PatternNamedItem :: { (Identifier, Expr) }
: Identifier ":" Expr { ($1, $3) }
| "default" ":" Expr { (tokenString $1, $3) }
PatternUnnamedItems :: { [Expr] }
: Exprs { $1 }
: PatternUnnamedItem { [$1] }
| PatternUnnamedItems "," PatternUnnamedItem { $1 ++ [$3] }
PatternUnnamedItem :: { Expr }
: Expr { $1 }
| Expr Concat { Repeat $1 $2 }
Concat :: { [Expr] }
: "{" Exprs "}" { $2 }