Add support for matchers nonterminals.

This commit is contained in:
Paul Stansifer 2012-07-06 14:48:01 -07:00
parent cabee6391d
commit caa83b41bb
3 changed files with 19 additions and 11 deletions

View file

@ -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)}
}
}