From 7051d622c0536718816152b14ff04a0072884d7e Mon Sep 17 00:00:00 2001 From: Paul Stansifer Date: Mon, 26 Nov 2012 22:34:01 -0500 Subject: Properly sync macro_parser.rs after it escapes out to the Rust parser. Closes #3201. --- src/libsyntax/parse/parser.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 52e001f8d5c..96364790956 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -191,6 +191,7 @@ fn Parser(sess: parse_sess, cfg: ast::crate_cfg, buffer: [mut {tok: tok0.tok, sp: span0}, ..4], buffer_start: 0, buffer_end: 0, + tokens_consumed: 0u, restriction: UNRESTRICTED, quote_depth: 0u, keywords: token::keyword_table(), @@ -209,6 +210,7 @@ struct Parser { mut buffer: [mut {tok: token::Token, sp: span} * 4], mut buffer_start: int, mut buffer_end: int, + mut tokens_consumed: uint, mut restriction: restriction, mut quote_depth: uint, // not (yet) related to the quasiquoter reader: reader, @@ -235,6 +237,7 @@ impl Parser { }; self.token = next.tok; self.span = next.sp; + self.tokens_consumed += 1u; } fn swap(next: token::Token, +lo: BytePos, +hi: BytePos) { self.token = next; -- cgit 1.4.1-3-g733a5