Add support for matchers nonterminals.
This commit is contained in:
parent
cabee6391d
commit
caa83b41bb
3 changed files with 19 additions and 11 deletions
|
|
@ -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)}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue