From 87761c1f99805006e7c47933271b76ef631e400a Mon Sep 17 00:00:00 2001 From: Jan Kobler Date: Sat, 17 Aug 2013 02:10:46 +0200 Subject: [PATCH 1/2] extract_grammar symnames add missing symnames Signed-off-by: Jan Kobler --- src/etc/extract_grammar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/etc/extract_grammar.py b/src/etc/extract_grammar.py index 58d1975c042b7..61aabf1d881cc 100755 --- a/src/etc/extract_grammar.py +++ b/src/etc/extract_grammar.py @@ -93,7 +93,11 @@ "//": "linecomment", "/*": "openblockcomment", -"*/": "closeblockcomment" +"*/": "closeblockcomment", +"macro_rules": "macro_rules", +"=>" : "eg", +".." : "dotdot", +"," : "comma" } lines = [] From c5c4a63aeb1dd59c6fc944bb9ac51dca550ec772 Mon Sep 17 00:00:00 2001 From: Jan Kobler Date: Sat, 17 Aug 2013 02:11:19 +0200 Subject: [PATCH 2/2] insert space in the rust grammar to avoid error messages like this: Exception: non-alpha apparent keyword: pub" when using extract_grammar.py: python2.7 src/etc/extract_grammar.py --- doc/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index d285253ffe200..aae54bdb839d2 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 derferenced 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] ~~~~~~~~