Skip to content

Commit c87d798

Browse files
committed
auto merge of #8585 : jankobler/rust/extract-grammar-01, r=catamorphism
This fixes some errors which extract_grammar.py reports, when called with python2.7 src/etc/extract_grammar.py <doc/rust.md
2 parents d4d856b + c5c4a63 commit c87d798

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ extern mod complicated_mod = "some-file/in/the-rust/path";
788788
##### Use declarations
789789

790790
~~~~~~~~ {.ebnf .gram}
791-
use_decl : "pub"? "use" ident [ '=' path
791+
use_decl : "pub" ? "use" ident [ '=' path
792792
| "::" path_glob ] ;
793793
794794
path_glob : ident [ "::" path_glob ] ?
@@ -1920,7 +1920,7 @@ it is automatically dereferenced to make the field access possible.
19201920
### Vector expressions
19211921

19221922
~~~~~~~~{.ebnf .gram}
1923-
vec_expr : '[' "mut"? vec_elems? ']'
1923+
vec_expr : '[' "mut" ? vec_elems? ']'
19241924
19251925
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr]
19261926
~~~~~~~~

src/etc/extract_grammar.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@
9393

9494
"//": "linecomment",
9595
"/*": "openblockcomment",
96-
"*/": "closeblockcomment"
96+
"*/": "closeblockcomment",
97+
"macro_rules": "macro_rules",
98+
"=>" : "eg",
99+
".." : "dotdot",
100+
"," : "comma"
97101
}
98102

99103
lines = []

0 commit comments

Comments
 (0)