diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-11 17:04:50 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-12-15 10:41:15 -0800 |
| commit | a87786e3e993564b444763f99dae24cdcb44a791 (patch) | |
| tree | 266903ba1a444bc9a1d2220055d32910e7aa194f /src/libsyntax | |
| parent | 8d52dfbace05c46754f4f6bb5a25f55906c9d7b0 (diff) | |
| download | rust-a87786e3e993564b444763f99dae24cdcb44a791.tar.gz rust-a87786e3e993564b444763f99dae24cdcb44a791.zip | |
librustc: Remove identifiers named `box`, since it's about to become a keyword.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/print/pp.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 13 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 9eae40e4c71..5138115746e 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -555,16 +555,18 @@ impl Printer { } // Convenience functions to talk to the printer. -pub fn box(p: @mut Printer, indent: uint, b: breaks) { +// +// "raw box" +pub fn rbox(p: @mut Printer, indent: uint, b: breaks) { p.pretty_print(BEGIN(begin_t { offset: indent as int, breaks: b })); } -pub fn ibox(p: @mut Printer, indent: uint) { box(p, indent, inconsistent); } +pub fn ibox(p: @mut Printer, indent: uint) { rbox(p, indent, inconsistent); } -pub fn cbox(p: @mut Printer, indent: uint) { box(p, indent, consistent); } +pub fn cbox(p: @mut Printer, indent: uint) { rbox(p, indent, consistent); } pub fn break_offset(p: @mut Printer, n: uint, off: int) { p.pretty_print(BREAK(break_t { diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 503d884c24d..568501a73bb 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -242,9 +242,10 @@ pub fn cbox(s: @ps, u: uint) { pp::cbox(s.s, u); } -pub fn box(s: @ps, u: uint, b: pp::breaks) { +// "raw box" +pub fn rbox(s: @ps, u: uint, b: pp::breaks) { s.boxes.push(b); - pp::box(s.s, u, b); + pp::rbox(s.s, u, b); } pub fn nbsp(s: @ps) { word(s.s, " "); } @@ -332,7 +333,7 @@ pub fn synth_comment(s: @ps, text: ~str) { } pub fn commasep<T>(s: @ps, b: breaks, elts: &[T], op: |@ps, &T|) { - box(s, 0u, b); + rbox(s, 0u, b); let mut first = true; for elt in elts.iter() { if first { first = false; } else { word_space(s, ","); } @@ -348,7 +349,7 @@ pub fn commasep_cmnt<T>( elts: &[T], op: |@ps, &T|, get_span: |&T| -> codemap::Span) { - box(s, 0u, b); + rbox(s, 0u, b); let len = elts.len(); let mut i = 0u; for elt in elts.iter() { @@ -1771,7 +1772,7 @@ pub fn print_fn_args(s: @ps, decl: &ast::fn_decl, opt_explicit_self: Option<ast::explicit_self_>) { // It is unfortunate to duplicate the commasep logic, but we want the // self type and the args all in the same box. - box(s, 0u, inconsistent); + rbox(s, 0u, inconsistent); let mut first = true; for explicit_self in opt_explicit_self.iter() { first = !print_explicit_self(s, *explicit_self); @@ -2071,7 +2072,7 @@ pub fn print_ty_fn(s: @ps, // It is unfortunate to duplicate the commasep logic, but we want the // self type and the args all in the same box. - box(s, 0u, inconsistent); + rbox(s, 0u, inconsistent); let mut first = true; for explicit_self in opt_explicit_self.iter() { first = !print_explicit_self(s, *explicit_self); |
