Adding token tree nonterminals to earley parser.

This commit is contained in:
Eric Holk 2012-07-05 16:31:19 -07:00
parent f0ef4ef81b
commit d09bcc0131
3 changed files with 2 additions and 2 deletions

View file

@ -105,8 +105,6 @@ impl methods for message {
ast::by_copy)], ast::by_copy)],
args_ast); args_ast);
let args = [#fmt("-pipe: %s", *this.data_name())]/~ + args;
let pat = alt (this.dir, next.dir) { let pat = alt (this.dir, next.dir) {
(send, send) { "(c, s)" } (send, send) { "(c, s)" }
(send, recv) { "(s, c)" } (send, recv) { "(s, c)" }

View file

@ -272,6 +272,7 @@ fn parse_nt(p: parser, name: str) -> whole_nt {
+ token::to_str(*p.reader.interner(), copy p.token)) } + token::to_str(*p.reader.interner(), copy p.token)) }
} } } }
"path" { token::w_path(p.parse_path_with_tps(false)) } "path" { token::w_path(p.parse_path_with_tps(false)) }
"tt" { token::w_tt(p.parse_token_tree()) }
_ { p.fatal("Unsupported builtin nonterminal parser: " + name)} _ { p.fatal("Unsupported builtin nonterminal parser: " + name)}
} }
} }

View file

@ -96,6 +96,7 @@ enum whole_nt {
w_ty( @ast::ty), w_ty( @ast::ty),
w_ident(str_num, bool), w_ident(str_num, bool),
w_path(@ast::path), w_path(@ast::path),
w_tt(ast::token_tree),
} }
fn binop_to_str(o: binop) -> str { fn binop_to_str(o: binop) -> str {