提交 e04c2476 编写于 作者: G Graydon Hoare

Add 'unexpected' fn to parser.

上级 8383b1c4
......@@ -68,6 +68,12 @@ fn next_def_id() -> ast.def_id {
npos, npos, 0, crate, rdr);
}
impure fn unexpected(parser p, token.token t) {
let str s = "unexpected token: ";
s += token.to_str(t);
p.err(s);
}
impure fn expect(parser p, token.token t) {
if (p.peek() == t) {
p.bump();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册