Skip to content

Commit 4504a27

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 39159 b: refs/heads/incoming c: 7051d62 h: refs/heads/master i: 39157: 3f8437d 39155: 352f2a4 39151: 3581d1e v: v3
1 parent 2f23a51 commit 4504a27

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 9ff8d1876630e7e3d1b0eef6c0c51610a19c4b98
9+
refs/heads/incoming: 7051d622c0536718816152b14ff04a0072884d7e
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/ext/expand.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,15 @@ fn core_macros() -> ~str {
349349
return
350350
~"{
351351
macro_rules! ignore (($($x:tt)*) => (()))
352-
#macro[[#error[f, ...], log(core::error, #fmt[f, ...])]];
353-
#macro[[#warn[f, ...], log(core::warn, #fmt[f, ...])]];
354-
#macro[[#info[f, ...], log(core::info, #fmt[f, ...])]];
355-
#macro[[#debug[f, ...], log(core::debug, #fmt[f, ...])]];
352+
353+
macro_rules! error ( ($( $arg:expr ),+) => (
354+
log(core::error, fmt!( $($arg),+ )) ))
355+
macro_rules! warn ( ($( $arg:expr ),+) => (
356+
log(core::warn, fmt!( $($arg),+ )) ))
357+
macro_rules! info ( ($( $arg:expr ),+) => (
358+
log(core::info, fmt!( $($arg),+ )) ))
359+
macro_rules! debug ( ($( $arg:expr ),+) => (
360+
log(core::debug, fmt!( $($arg),+ )) ))
356361

357362
macro_rules! die(
358363
($msg: expr) => (

branches/incoming/src/libsyntax/ext/tt/macro_parser.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
368368
}
369369
cur_eis.push(move ei);
370370
371-
/* this would fail if zero-length tokens existed */
372-
while rdr.peek().sp.lo < rust_parser.span.lo {
373-
rdr.next_token();
374-
} /* except for EOF... */
375-
while rust_parser.token == EOF && rdr.peek().tok != EOF {
371+
for rust_parser.tokens_consumed.times() || {
376372
rdr.next_token();
377373
}
378374
}

branches/incoming/src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ fn Parser(sess: parse_sess, cfg: ast::crate_cfg,
191191
buffer: [mut {tok: tok0.tok, sp: span0}, ..4],
192192
buffer_start: 0,
193193
buffer_end: 0,
194+
tokens_consumed: 0u,
194195
restriction: UNRESTRICTED,
195196
quote_depth: 0u,
196197
keywords: token::keyword_table(),
@@ -209,6 +210,7 @@ struct Parser {
209210
mut buffer: [mut {tok: token::Token, sp: span} * 4],
210211
mut buffer_start: int,
211212
mut buffer_end: int,
213+
mut tokens_consumed: uint,
212214
mut restriction: restriction,
213215
mut quote_depth: uint, // not (yet) related to the quasiquoter
214216
reader: reader,
@@ -235,6 +237,7 @@ impl Parser {
235237
};
236238
self.token = next.tok;
237239
self.span = next.sp;
240+
self.tokens_consumed += 1u;
238241
}
239242
fn swap(next: token::Token, +lo: BytePos, +hi: BytePos) {
240243
self.token = next;

0 commit comments

Comments
 (0)