diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 19 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 984ac9fb0e3..4558d0a1872 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -243,6 +243,7 @@ fn new_span(cx: ext_ctxt, sp: span) -> span { fn core_macros() -> ~str { return ~"{ + macro_rules! ignore (($($x:tt)*) => (())) #macro[[#error[f, ...], log(core::error, #fmt[f, ...])]]; #macro[[#warn[f, ...], log(core::warn, #fmt[f, ...])]]; #macro[[#info[f, ...], log(core::info, #fmt[f, ...])]]; diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index e4c5d233867..e93f3cfe9c6 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -267,21 +267,16 @@ fn consume_block_comment(rdr: string_reader) sp: ast_util::mk_sp(start_chpos, rdr.chpos) }); } - } - - let mut level: int = 1; - while level > 0 { - if is_eof(rdr) { rdr.fatal(~"unterminated block comment"); } - if rdr.curr == '/' && nextch(rdr) == '*' { - bump(rdr); - bump(rdr); - level += 1; - } else { + } else { + loop { + if is_eof(rdr) { rdr.fatal(~"unterminated block comment"); } if rdr.curr == '*' && nextch(rdr) == '/' { bump(rdr); bump(rdr); - level -= 1; - } else { bump(rdr); } + break; + } else { + bump(rdr); + } } } // restart whitespace munch. |
