diff --git a/doc/rust.md b/doc/rust.md index 4cd9dc3a116..16927d0de7a 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -788,7 +788,7 @@ extern mod complicated_mod = "some-file/in/the-rust/path"; ##### Use declarations ~~~~~~~~ {.ebnf .gram} -use_decl : "pub"? "use" ident [ '=' path +use_decl : "pub" ? "use" ident [ '=' path | "::" path_glob ] ; path_glob : ident [ "::" path_glob ] ? @@ -1920,7 +1920,7 @@ it is automatically dereferenced to make the field access possible. ### Vector expressions ~~~~~~~~{.ebnf .gram} -vec_expr : '[' "mut"? vec_elems? ']' +vec_expr : '[' "mut" ? vec_elems? ']' vec_elems : [expr [',' expr]*] | [expr ',' ".." expr] ~~~~~~~~ diff --git a/src/etc/extract_grammar.py b/src/etc/extract_grammar.py index 58d1975c042..61aabf1d881 100755 --- a/src/etc/extract_grammar.py +++ b/src/etc/extract_grammar.py @@ -93,7 +93,11 @@ symnames = { "//": "linecomment", "/*": "openblockcomment", -"*/": "closeblockcomment" +"*/": "closeblockcomment", +"macro_rules": "macro_rules", +"=>" : "eg", +".." : "dotdot", +"," : "comma" } lines = []