diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-21 13:08:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-22 08:09:56 -0700 |
| commit | daf5f5a4d10513ff42e79fa7ef8819b170f3a13d (patch) | |
| tree | 7a07a79c43e02debcc6bbb33d90a5e41b70119e6 /src/libsyntax/parse | |
| parent | 15a6bdebab4e7b811b9a902e3f8ed225c59af06e (diff) | |
| download | rust-daf5f5a4d10513ff42e79fa7ef8819b170f3a13d.tar.gz rust-daf5f5a4d10513ff42e79fa7ef8819b170f3a13d.zip | |
Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 32 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 26 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 6 |
6 files changed, 40 insertions, 40 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index dba2f0b9417..a8132860b9b 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -32,7 +32,7 @@ impl parser_attr for Parser { fn parse_outer_attributes(&self) -> ~[ast::Attribute] { let mut attrs: ~[ast::Attribute] = ~[]; loop { - debug2!("parse_outer_attributes: self.token={:?}", + debug!("parse_outer_attributes: self.token={:?}", self.token); match *self.token { token::INTERPOLATED(token::nt_attr(*)) => { @@ -67,7 +67,7 @@ impl parser_attr for Parser { // if permit_inner is true, then a trailing `;` indicates an inner // attribute fn parse_attribute(&self, permit_inner: bool) -> ast::Attribute { - debug2!("parse_attributes: permit_inner={:?} self.token={:?}", + debug!("parse_attributes: permit_inner={:?} self.token={:?}", permit_inner, self.token); let (span, value) = match *self.token { INTERPOLATED(token::nt_attr(attr)) => { diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index f163bec7d4e..38921648a2b 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -134,7 +134,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> ~str { return lines.connect("\n"); } - fail2!("not a doc-comment: {}", comment); + fail!("not a doc-comment: {}", comment); } fn read_to_eol(rdr: @mut StringReader) -> ~str { @@ -161,7 +161,7 @@ fn consume_non_eol_whitespace(rdr: @mut StringReader) { } fn push_blank_line_comment(rdr: @mut StringReader, comments: &mut ~[cmnt]) { - debug2!(">>> blank-line comment"); + debug!(">>> blank-line comment"); let v: ~[~str] = ~[]; comments.push(cmnt {style: blank_line, lines: v, pos: rdr.last_pos}); } @@ -179,9 +179,9 @@ fn consume_whitespace_counting_blank_lines(rdr: @mut StringReader, fn read_shebang_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> shebang comment"); + debug!(">>> shebang comment"); let p = rdr.last_pos; - debug2!("<<< shebang comment"); + debug!("<<< shebang comment"); comments.push(cmnt { style: if code_to_the_left { trailing } else { isolated }, lines: ~[read_one_line_comment(rdr)], @@ -191,19 +191,19 @@ fn read_shebang_comment(rdr: @mut StringReader, code_to_the_left: bool, fn read_line_comments(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> line comments"); + debug!(">>> line comments"); let p = rdr.last_pos; let mut lines: ~[~str] = ~[]; while rdr.curr == '/' && nextch(rdr) == '/' { let line = read_one_line_comment(rdr); - debug2!("{}", line); + debug!("{}", line); if is_doc_comment(line) { // doc-comments are not put in comments break; } lines.push(line); consume_non_eol_whitespace(rdr); } - debug2!("<<< line comments"); + debug!("<<< line comments"); if !lines.is_empty() { comments.push(cmnt { style: if code_to_the_left { trailing } else { isolated }, @@ -242,14 +242,14 @@ fn trim_whitespace_prefix_and_push_line(lines: &mut ~[~str], } None => s, }; - debug2!("pushing line: {}", s1); + debug!("pushing line: {}", s1); lines.push(s1); } fn read_block_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> block comment"); + debug!(">>> block comment"); let p = rdr.last_pos; let mut lines: ~[~str] = ~[]; let col: CharPos = rdr.col; @@ -275,7 +275,7 @@ fn read_block_comment(rdr: @mut StringReader, } else { let mut level: int = 1; while level > 0 { - debug2!("=== block comment level {}", level); + debug!("=== block comment level {}", level); if is_eof(rdr) { (rdr as @mut reader).fatal(~"unterminated block comment"); } @@ -311,7 +311,7 @@ fn read_block_comment(rdr: @mut StringReader, if !is_eof(rdr) && rdr.curr != '\n' && lines.len() == 1u { style = mixed; } - debug2!("<<< block comment"); + debug!("<<< block comment"); comments.push(cmnt {style: style, lines: lines, pos: p}); } @@ -324,15 +324,15 @@ fn peeking_at_comment(rdr: @mut StringReader) -> bool { fn consume_comment(rdr: @mut StringReader, code_to_the_left: bool, comments: &mut ~[cmnt]) { - debug2!(">>> consume comment"); + debug!(">>> consume comment"); if rdr.curr == '/' && nextch(rdr) == '/' { read_line_comments(rdr, code_to_the_left, comments); } else if rdr.curr == '/' && nextch(rdr) == '*' { read_block_comment(rdr, code_to_the_left, comments); } else if rdr.curr == '#' && nextch(rdr) == '!' { read_shebang_comment(rdr, code_to_the_left, comments); - } else { fail2!(); } - debug2!("<<< consume comment"); + } else { fail!(); } + debug!("<<< consume comment"); } #[deriving(Clone)] @@ -378,11 +378,11 @@ pub fn gather_comments_and_literals(span_diagnostic: let TokenAndSpan {tok: tok, sp: sp} = rdr.peek(); if token::is_lit(&tok) { do with_str_from(rdr, bstart) |s| { - debug2!("tok lit: {}", s); + debug!("tok lit: {}", s); literals.push(lit {lit: s.to_owned(), pos: sp.lo}); } } else { - debug2!("tok: {}", token::to_str(get_ident_interner(), &tok)); + debug!("tok: {}", token::to_str(get_ident_interner(), &tok)); } first_read = false; } diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 8edc171fcac..7ac999c46a4 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -133,7 +133,7 @@ impl reader for TtReader { fn is_eof(@mut self) -> bool { self.cur_tok == token::EOF } fn next_token(@mut self) -> TokenAndSpan { let r = tt_next_token(self); - debug2!("TtReader: r={:?}", r); + debug!("TtReader: r={:?}", r); return r; } fn fatal(@mut self, m: ~str) -> ! { @@ -273,7 +273,7 @@ fn hex_digit_val(c: char) -> int { if in_range(c, '0', '9') { return (c as int) - ('0' as int); } if in_range(c, 'a', 'f') { return (c as int) - ('a' as int) + 10; } if in_range(c, 'A', 'F') { return (c as int) - ('A' as int) + 10; } - fail2!(); + fail!(); } fn bin_digit_value(c: char) -> int { if c == '0' { return 0; } return 1; } @@ -576,7 +576,7 @@ fn scan_number(c: char, rdr: @mut StringReader) -> token::Token { ~"int literal is too large") }; - debug2!("lexing {} as an unsuffixed integer literal", num_str); + debug!("lexing {} as an unsuffixed integer literal", num_str); return token::LIT_INT_UNSUFFIXED(parsed as i64); } } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 05998d80213..c9405d72464 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -417,18 +417,18 @@ mod test { _ => assert_eq!("wrong 4","correct") }, _ => { - error2!("failing value 3: {:?}",first_set); + error!("failing value 3: {:?}",first_set); assert_eq!("wrong 3","correct") } }, _ => { - error2!("failing value 2: {:?}",delim_elts); + error!("failing value 2: {:?}",delim_elts); assert_eq!("wrong","correct"); } }, _ => { - error2!("failing value: {:?}",tts); + error!("failing value: {:?}",tts); assert_eq!("wrong 1","correct"); } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c776e5bfd38..ed6019e1a55 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -448,7 +448,7 @@ impl Parser { // followed by some token from the set edible + inedible. Recover // from anticipated input errors, discarding erroneous characters. pub fn commit_expr(&self, e: @Expr, edible: &[token::Token], inedible: &[token::Token]) { - debug2!("commit_expr {:?}", e); + debug!("commit_expr {:?}", e); match e.node { ExprPath(*) => { // might be unit-struct construction; check for recoverableinput error. @@ -468,7 +468,7 @@ impl Parser { // followed by some token from the set edible + inedible. Check // for recoverable input errors, discarding erroneous characters. pub fn commit_stmt(&self, s: @Stmt, edible: &[token::Token], inedible: &[token::Token]) { - debug2!("commit_stmt {:?}", s); + debug!("commit_stmt {:?}", s); let _s = s; // unused, but future checks might want to inspect `s`. if self.last_token.as_ref().map_default(false, |t| is_ident_or_path(*t)) { let expected = vec::append(edible.to_owned(), inedible); @@ -933,13 +933,13 @@ impl Parser { }; let hi = p.last_span.hi; - debug2!("parse_trait_methods(): trait method signature ends in \ + debug!("parse_trait_methods(): trait method signature ends in \ `{}`", self.this_token_to_str()); match *p.token { token::SEMI => { p.bump(); - debug2!("parse_trait_methods(): parsing required method"); + debug!("parse_trait_methods(): parsing required method"); // NB: at the moment, visibility annotations on required // methods are ignored; this could change. if vis != ast::inherited { @@ -958,7 +958,7 @@ impl Parser { }) } token::LBRACE => { - debug2!("parse_trait_methods(): parsing provided method"); + debug!("parse_trait_methods(): parsing provided method"); let (inner_attrs, body) = p.parse_inner_attrs_and_block(); let attrs = vec::append(attrs, inner_attrs); @@ -1196,7 +1196,7 @@ impl Parser { _ => 0 }; - debug2!("parser is_named_argument offset:{}", offset); + debug!("parser is_named_argument offset:{}", offset); if offset == 0 { is_plain_ident_or_underscore(&*self.token) @@ -1212,7 +1212,7 @@ impl Parser { pub fn parse_arg_general(&self, require_name: bool) -> arg { let is_mutbl = self.eat_keyword(keywords::Mut); let pat = if require_name || self.is_named_argument() { - debug2!("parse_arg_general parse_pat (require_name:{:?})", + debug!("parse_arg_general parse_pat (require_name:{:?})", require_name); let pat = self.parse_pat(); @@ -1223,7 +1223,7 @@ impl Parser { self.expect(&token::COLON); pat } else { - debug2!("parse_arg_general ident_to_pat"); + debug!("parse_arg_general ident_to_pat"); ast_util::ident_to_pat(ast::DUMMY_NODE_ID, *self.last_span, special_idents::invalid) @@ -2470,7 +2470,7 @@ impl Parser { // There may be other types of expressions that can // represent the callee in `for` and `do` expressions // but they aren't represented by tests - debug2!("sugary call on {:?}", e.node); + debug!("sugary call on {:?}", e.node); self.span_fatal( e.span, format!("`{}` must be followed by a block call", keyword)); @@ -3916,7 +3916,7 @@ impl Parser { attrs = attrs_remaining + attrs; first = false; } - debug2!("parse_mod_items: parse_item_or_view_item(attrs={:?})", + debug!("parse_mod_items: parse_item_or_view_item(attrs={:?})", attrs); match self.parse_item_or_view_item(attrs, true /* macros allowed */) { @@ -4629,7 +4629,7 @@ impl Parser { let first_ident = self.parse_ident(); let mut path = ~[first_ident]; - debug2!("parsed view_path: {}", self.id_to_str(first_ident)); + debug!("parsed view_path: {}", self.id_to_str(first_ident)); match *self.token { token::EQ => { // x = foo::bar @@ -4837,7 +4837,7 @@ impl Parser { break; } iovi_foreign_item(_) => { - fail2!(); + fail!(); } } attrs = self.parse_outer_attributes(); @@ -4860,7 +4860,7 @@ impl Parser { items.push(item) } iovi_foreign_item(_) => { - fail2!(); + fail!(); } } } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index eae3e665b58..27747d94b66 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -219,8 +219,8 @@ pub fn to_str(input: @ident_interner, t: &Token) -> ~str { nt_block(*) => ~"block", nt_stmt(*) => ~"statement", nt_pat(*) => ~"pattern", - nt_attr(*) => fail2!("should have been handled"), - nt_expr(*) => fail2!("should have been handled above"), + nt_attr(*) => fail!("should have been handled"), + nt_expr(*) => fail!("should have been handled above"), nt_ty(*) => ~"type", nt_ident(*) => ~"identifier", nt_path(*) => ~"path", @@ -275,7 +275,7 @@ pub fn flip_delimiter(t: &token::Token) -> token::Token { RPAREN => LPAREN, RBRACE => LBRACE, RBRACKET => LBRACKET, - _ => fail2!() + _ => fail!() } } |
