aboutsummaryrefslogtreecommitdiff
path: root/src/comp/pretty/pp.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-16 14:58:02 -0700
committerGraydon Hoare <[email protected]>2011-03-16 14:58:02 -0700
commit54587bdccb7b6771cfc704a30fc0ef2c65824a15 (patch)
tree6f154f9b038e9542b364e87ae887858a96bdb4a9 /src/comp/pretty/pp.rs
parentAdd some more dlopen-related suppressions for the Mac (diff)
downloadrust-54587bdccb7b6771cfc704a30fc0ef2c65824a15.tar.xz
rust-54587bdccb7b6771cfc704a30fc0ef2c65824a15.zip
Switch all vases of vec += elt to vec += vec. Prohibit former in rustboot. Tweak std lib vec fns in process.
Diffstat (limited to 'src/comp/pretty/pp.rs')
-rw-r--r--src/comp/pretty/pp.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/comp/pretty/pp.rs b/src/comp/pretty/pp.rs
index d3145180..0c355001 100644
--- a/src/comp/pretty/pp.rs
+++ b/src/comp/pretty/pp.rs
@@ -39,12 +39,12 @@ fn mkstate(io.writer out, uint width) -> ps {
impure fn push_context(ps p, contexttype tp, uint indent) {
before_print(p, false);
- p.context = _vec.push[context](p.context, rec(tp=tp, indent=base_indent(p)
- + indent));
+ _vec.push[context](p.context, rec(tp=tp, indent=base_indent(p)
+ + indent));
}
-impure fn pop_context(ps p) {
- p.context = _vec.pop[context](p.context);
+fn pop_context(ps p) {
+ _vec.pop[context](p.context);
}
impure fn add_token(ps p, token tok) {
@@ -110,7 +110,8 @@ impure fn finish_block_scan(ps p, contexttype tp) {
}
p.scandepth = 0u;
push_context(p, tp, indent);
- for (token t in _vec.shift[token](p.buffered)) {add_token(p, t);}
+ _vec.shift[token](p.buffered);
+ for (token t in p.buffered) { add_token(p, t); }
}
impure fn finish_break_scan(ps p) {
@@ -125,7 +126,8 @@ impure fn finish_break_scan(ps p) {
p.col += width;
}
p.scandepth = 0u;
- for (token t in _vec.shift[token](p.buffered)) {add_token(p, t);}
+ _vec.shift[token](p.buffered);
+ for (token t in p.buffered) { add_token(p, t); }
}
impure fn start_scan(ps p, token tok) {