diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-06 14:48:01 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-09 17:44:46 -0700 |
| commit | caa83b41bba2b63c8b55193d176d40f5eb0fa9a8 (patch) | |
| tree | 050763eab3982b739251cda7ca3c404c9dd8542e /src/libsyntax/ext/tt | |
| parent | cabee6391d599be867b80f81de219d9f982585f5 (diff) | |
| download | rust-caa83b41bba2b63c8b55193d176d40f5eb0fa9a8.tar.gz rust-caa83b41bba2b63c8b55193d176d40f5eb0fa9a8.zip | |
Add support for matchers nonterminals.
Diffstat (limited to 'src/libsyntax/ext/tt')
| -rw-r--r-- | src/libsyntax/ext/tt/earley_parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/earley_parser.rs b/src/libsyntax/ext/tt/earley_parser.rs index 191da586ce5..f890661e239 100644 --- a/src/libsyntax/ext/tt/earley_parser.rs +++ b/src/libsyntax/ext/tt/earley_parser.rs @@ -272,7 +272,13 @@ fn parse_nt(p: parser, name: str) -> whole_nt { + token::to_str(*p.reader.interner(), copy p.token)) } } } "path" { token::w_path(p.parse_path_with_tps(false)) } - "tt" { token::w_tt(@p.parse_token_tree()) } + "tt" { + p.quote_depth += 1u; + let res = token::w_tt(@p.parse_token_tree()); + p.quote_depth -= 1u; + res + } + "mtcs" { token::w_mtcs(p.parse_matchers()) } _ { p.fatal("Unsupported builtin nonterminal parser: " + name)} } } |
