summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-21 13:08:31 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-10-22 08:09:56 -0700
commitdaf5f5a4d10513ff42e79fa7ef8819b170f3a13d (patch)
tree7a07a79c43e02debcc6bbb33d90a5e41b70119e6 /src/libsyntax/print
parent15a6bdebab4e7b811b9a902e3f8ed225c59af06e (diff)
downloadrust-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/print')
-rw-r--r--src/libsyntax/print/pp.rs52
-rw-r--r--src/libsyntax/print/pprust.rs14
2 files changed, 33 insertions, 33 deletions
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs
index 58d73ad687c..871584003b5 100644
--- a/src/libsyntax/print/pp.rs
+++ b/src/libsyntax/print/pp.rs
@@ -152,7 +152,7 @@ pub fn mk_printer(out: @io::Writer, linewidth: uint) -> @mut Printer {
     // Yes 3, it makes the ring buffers big enough to never
     // fall behind.
     let n: uint = 3 * linewidth;
-    debug2!("mk_printer {}", linewidth);
+    debug!("mk_printer {}", linewidth);
     let token: ~[token] = vec::from_elem(n, EOF);
     let size: ~[int] = vec::from_elem(n, 0);
     let scan_stack: ~[uint] = vec::from_elem(n, 0u);
@@ -288,7 +288,7 @@ impl Printer {
         self.token[self.right] = t;
     }
     pub fn pretty_print(&mut self, t: token) {
-        debug2!("pp ~[{},{}]", self.left, self.right);
+        debug!("pp ~[{},{}]", self.left, self.right);
         match t {
           EOF => {
             if !self.scan_stack_empty {
@@ -305,7 +305,7 @@ impl Printer {
                 self.left = 0u;
                 self.right = 0u;
             } else { self.advance_right(); }
-            debug2!("pp BEGIN({})/buffer ~[{},{}]",
+            debug!("pp BEGIN({})/buffer ~[{},{}]",
                    b.offset, self.left, self.right);
             self.token[self.right] = t;
             self.size[self.right] = -self.right_total;
@@ -313,10 +313,10 @@ impl Printer {
           }
           END => {
             if self.scan_stack_empty {
-                debug2!("pp END/print ~[{},{}]", self.left, self.right);
+                debug!("pp END/print ~[{},{}]", self.left, self.right);
                 self.print(t, 0);
             } else {
-                debug2!("pp END/buffer ~[{},{}]", self.left, self.right);
+                debug!("pp END/buffer ~[{},{}]", self.left, self.right);
                 self.advance_right();
                 self.token[self.right] = t;
                 self.size[self.right] = -1;
@@ -330,7 +330,7 @@ impl Printer {
                 self.left = 0u;
                 self.right = 0u;
             } else { self.advance_right(); }
-            debug2!("pp BREAK({})/buffer ~[{},{}]",
+            debug!("pp BREAK({})/buffer ~[{},{}]",
                    b.offset, self.left, self.right);
             self.check_stack(0);
             self.scan_push(self.right);
@@ -340,11 +340,11 @@ impl Printer {
           }
           STRING(s, len) => {
             if self.scan_stack_empty {
-                debug2!("pp STRING('{}')/print ~[{},{}]",
+                debug!("pp STRING('{}')/print ~[{},{}]",
                        s, self.left, self.right);
                 self.print(t, len);
             } else {
-                debug2!("pp STRING('{}')/buffer ~[{},{}]",
+                debug!("pp STRING('{}')/buffer ~[{},{}]",
                        s, self.left, self.right);
                 self.advance_right();
                 self.token[self.right] = t;
@@ -356,14 +356,14 @@ impl Printer {
         }
     }
     pub fn check_stream(&mut self) {
-        debug2!("check_stream ~[{}, {}] with left_total={}, right_total={}",
+        debug!("check_stream ~[{}, {}] with left_total={}, right_total={}",
                self.left, self.right, self.left_total, self.right_total);
         if self.right_total - self.left_total > self.space {
-            debug2!("scan window is {}, longer than space on line ({})",
+            debug!("scan window is {}, longer than space on line ({})",
                    self.right_total - self.left_total, self.space);
             if !self.scan_stack_empty {
                 if self.left == self.scan_stack[self.bottom] {
-                    debug2!("setting {} to infinity and popping", self.left);
+                    debug!("setting {} to infinity and popping", self.left);
                     self.size[self.scan_pop_bottom()] = size_infinity;
                 }
             }
@@ -372,7 +372,7 @@ impl Printer {
         }
     }
     pub fn scan_push(&mut self, x: uint) {
-        debug2!("scan_push {}", x);
+        debug!("scan_push {}", x);
         if self.scan_stack_empty {
             self.scan_stack_empty = false;
         } else {
@@ -408,7 +408,7 @@ impl Printer {
         assert!((self.right != self.left));
     }
     pub fn advance_left(&mut self, x: token, L: int) {
-        debug2!("advnce_left ~[{},{}], sizeof({})={}", self.left, self.right,
+        debug!("advnce_left ~[{},{}], sizeof({})={}", self.left, self.right,
                self.left, L);
         if L >= 0 {
             self.print(x, L);
@@ -451,13 +451,13 @@ impl Printer {
         }
     }
     pub fn print_newline(&mut self, amount: int) {
-        debug2!("NEWLINE {}", amount);
+        debug!("NEWLINE {}", amount);
         (*self.out).write_str("\n");
         self.pending_indentation = 0;
         self.indent(amount);
     }
     pub fn indent(&mut self, amount: int) {
-        debug2!("INDENT {}", amount);
+        debug!("INDENT {}", amount);
         self.pending_indentation += amount;
     }
     pub fn get_top(&mut self) -> print_stack_elt {
@@ -480,9 +480,9 @@ impl Printer {
         (*self.out).write_str(s);
     }
     pub fn print(&mut self, x: token, L: int) {
-        debug2!("print {} {} (remaining line space={})", tok_str(x), L,
+        debug!("print {} {} (remaining line space={})", tok_str(x), L,
                self.space);
-        debug2!("{}", buf_str(self.token.clone(),
+        debug!("{}", buf_str(self.token.clone(),
                              self.size.clone(),
                              self.left,
                              self.right,
@@ -491,13 +491,13 @@ impl Printer {
           BEGIN(b) => {
             if L > self.space {
                 let col = self.margin - self.space + b.offset;
-                debug2!("print BEGIN -> push broken block at col {}", col);
+                debug!("print BEGIN -> push broken block at col {}", col);
                 self.print_stack.push(print_stack_elt {
                     offset: col,
                     pbreak: broken(b.breaks)
                 });
             } else {
-                debug2!("print BEGIN -> push fitting block");
+                debug!("print BEGIN -> push fitting block");
                 self.print_stack.push(print_stack_elt {
                     offset: 0,
                     pbreak: fits
@@ -505,7 +505,7 @@ impl Printer {
             }
           }
           END => {
-            debug2!("print END -> pop END");
+            debug!("print END -> pop END");
             let print_stack = &mut *self.print_stack;
             assert!((print_stack.len() != 0u));
             print_stack.pop();
@@ -514,24 +514,24 @@ impl Printer {
             let top = self.get_top();
             match top.pbreak {
               fits => {
-                debug2!("print BREAK({}) in fitting block", b.blank_space);
+                debug!("print BREAK({}) in fitting block", b.blank_space);
                 self.space -= b.blank_space;
                 self.indent(b.blank_space);
               }
               broken(consistent) => {
-                debug2!("print BREAK({}+{}) in consistent block",
+                debug!("print BREAK({}+{}) in consistent block",
                        top.offset, b.offset);
                 self.print_newline(top.offset + b.offset);
                 self.space = self.margin - (top.offset + b.offset);
               }
               broken(inconsistent) => {
                 if L > self.space {
-                    debug2!("print BREAK({}+{}) w/ newline in inconsistent",
+                    debug!("print BREAK({}+{}) w/ newline in inconsistent",
                            top.offset, b.offset);
                     self.print_newline(top.offset + b.offset);
                     self.space = self.margin - (top.offset + b.offset);
                 } else {
-                    debug2!("print BREAK({}) w/o newline in inconsistent",
+                    debug!("print BREAK({}) w/o newline in inconsistent",
                            b.blank_space);
                     self.indent(b.blank_space);
                     self.space -= b.blank_space;
@@ -540,7 +540,7 @@ impl Printer {
             }
           }
           STRING(s, len) => {
-            debug2!("print STRING({})", s);
+            debug!("print STRING({})", s);
             assert_eq!(L, len);
             // assert!(L <= space);
             self.space -= len;
@@ -548,7 +548,7 @@ impl Printer {
           }
           EOF => {
             // EOF should never get here.
-            fail2!();
+            fail!();
           }
         }
     }
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 0d442dca9b6..b245bd75ace 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -453,10 +453,10 @@ pub fn print_type(s: @ps, ty: &ast::Ty) {
           word(s.s, ")");
       }
       ast::ty_mac(_) => {
-          fail2!("print_type doesn't know how to print a ty_mac");
+          fail!("print_type doesn't know how to print a ty_mac");
       }
       ast::ty_infer => {
-          fail2!("print_type shouldn't see a ty_infer");
+          fail!("print_type shouldn't see a ty_infer");
       }
 
     }
@@ -701,7 +701,7 @@ pub fn print_struct(s: @ps,
             popen(s);
             do commasep(s, inconsistent, struct_def.fields) |s, field| {
                 match field.node.kind {
-                    ast::named_field(*) => fail2!("unexpected named field"),
+                    ast::named_field(*) => fail!("unexpected named field"),
                     ast::unnamed_field => {
                         maybe_print_comment(s, field.span.lo);
                         print_type(s, &field.node.ty);
@@ -720,7 +720,7 @@ pub fn print_struct(s: @ps,
 
         for field in struct_def.fields.iter() {
             match field.node.kind {
-                ast::unnamed_field => fail2!("unexpected unnamed field"),
+                ast::unnamed_field => fail!("unexpected unnamed field"),
                 ast::named_field(ident, visibility) => {
                     hardbreak_if_not_bol(s);
                     maybe_print_comment(s, field.span.lo);
@@ -1009,7 +1009,7 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block,
               }
               // BLEAH, constraints would be great here
               _ => {
-                  fail2!("print_if saw if with weird alternative");
+                  fail!("print_if saw if with weird alternative");
               }
             }
           }
@@ -1311,7 +1311,7 @@ pub fn print_expr(s: @ps, expr: &ast::Expr) {
                         }
                         end(s); // close enclosing cbox
                     }
-                    None => fail2!()
+                    None => fail!()
                 }
             } else {
                 // the block will close the pattern's ibox
@@ -2304,7 +2304,7 @@ mod test {
 
     fn string_check<T:Eq> (given : &T, expected: &T) {
         if !(given == expected) {
-            fail2!("given {:?}, expected {:?}", given, expected);
+            fail!("given {:?}, expected {:?}", given, expected);
         }
     }