about summary refs log tree commit diff
path: root/src/doc/grammar.md
diff options
context:
space:
mode:
authortheduke <chris@theduke.at>2017-01-10 12:35:04 +0100
committertheduke <chris@theduke.at>2017-01-10 13:09:17 +0100
commit487ca5ccc52fe27b9352c2b467c91d231ecf9ae7 (patch)
tree34bcb08aab18a05a5b484a278a90cca305a3b169 /src/doc/grammar.md
parent78c892d8659ae1cf1717b9a8a4bb407d8667f672 (diff)
downloadrust-487ca5ccc52fe27b9352c2b467c91d231ecf9ae7.tar.gz
rust-487ca5ccc52fe27b9352c2b467c91d231ecf9ae7.zip
Update struct_expr grammar for field init shorthand.
Diffstat (limited to 'src/doc/grammar.md')
-rw-r--r--src/doc/grammar.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/doc/grammar.md b/src/doc/grammar.md
index 690d44cc2cb..c81f2e2282b 100644
--- a/src/doc/grammar.md
+++ b/src/doc/grammar.md
@@ -510,8 +510,9 @@ unit_expr : "()" ;
 ### Structure expressions
 
 ```antlr
-struct_expr : expr_path '{' ident ':' expr
-                      [ ',' ident ':' expr ] *
+struct_expr_field_init : ident | ident ':' expr ;
+struct_expr : expr_path '{' struct_expr_field_init
+                      [ ',' struct_expr_field_init ] *
                       [ ".." expr ] '}' |
               expr_path '(' expr
                       [ ',' expr ] * ')' |