Skip to content

Commit 487ca5c

Browse files
committed
Update struct_expr grammar for field init shorthand.
1 parent 78c892d commit 487ca5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/doc/grammar.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,9 @@ unit_expr : "()" ;
510510
### Structure expressions
511511

512512
```antlr
513-
struct_expr : expr_path '{' ident ':' expr
514-
[ ',' ident ':' expr ] *
513+
struct_expr_field_init : ident | ident ':' expr ;
514+
struct_expr : expr_path '{' struct_expr_field_init
515+
[ ',' struct_expr_field_init ] *
515516
[ ".." expr ] '}' |
516517
expr_path '(' expr
517518
[ ',' expr ] * ')' |

0 commit comments

Comments
 (0)