Skip to content

Commit 422895a

Browse files
author
Giang Nguyen
authored
Update grammar struct field init shorthand
1 parent 3dcb288 commit 422895a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/doc/grammar.md

Lines changed: 3 additions & 2 deletions
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+
field_init : ident | ident ':' expr;
514+
struct_expr : expr_path '{' field_init
515+
[ ',' field_init ] *
515516
[ ".." expr ] '}' |
516517
expr_path '(' expr
517518
[ ',' expr ] * ')' |

0 commit comments

Comments
 (0)