Skip to content

Commit c5ae01f

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 37775 b: refs/heads/try c: 7051d62 h: refs/heads/master i: 37773: 5fbb693 37771: c86c0b2 37767: 0be5f7f 37759: 23dcae7 v: v3
1 parent 1c501f4 commit c5ae01f

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 9ff8d1876630e7e3d1b0eef6c0c51610a19c4b98
5+
refs/heads/try: 7051d622c0536718816152b14ff04a0072884d7e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/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/try/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/try/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)