about summary refs log tree commit diff
path: root/src/libsyntax/print/pp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/print/pp.rs')
-rw-r--r--src/libsyntax/print/pp.rs38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs
index 1a318d53635..79679279f07 100644
--- a/src/libsyntax/print/pp.rs
+++ b/src/libsyntax/print/pp.rs
@@ -103,22 +103,22 @@ fn mk_printer(out: io::writer, linewidth: uint) -> printer {
     let token: ~[mut token] = vec::to_mut(vec::from_elem(n, EOF));
     let size: ~[mut int] = vec::to_mut(vec::from_elem(n, 0));
     let scan_stack: ~[mut uint] = vec::to_mut(vec::from_elem(n, 0u));
-    @{out: out,
-      buf_len: n,
-      mut margin: linewidth as int,
-      mut space: linewidth as int,
-      mut left: 0u,
-      mut right: 0u,
-      token: token,
-      size: size,
-      mut left_total: 0,
-      mut right_total: 0,
-      mut scan_stack: scan_stack,
-      mut scan_stack_empty: true,
-      mut top: 0u,
-      mut bottom: 0u,
-      print_stack: dvec(),
-      mut pending_indentation: 0}
+    printer_(@{out: out,
+               buf_len: n,
+               mut margin: linewidth as int,
+               mut space: linewidth as int,
+               mut left: 0u,
+               mut right: 0u,
+               token: token,
+               size: size,
+               mut left_total: 0,
+               mut right_total: 0,
+               mut scan_stack: scan_stack,
+               mut scan_stack_empty: true,
+               mut top: 0u,
+               mut bottom: 0u,
+               print_stack: dvec(),
+               mut pending_indentation: 0})
 }
 
 
@@ -199,7 +199,7 @@ fn mk_printer(out: io::writer, linewidth: uint) -> printer {
  * the method called 'pretty_print', and the 'PRINT' process is the method
  * called 'print'.
  */
-type printer = @{
+type printer_ = {
     out: io::writer,
     buf_len: uint,
     mut margin: int, // width of lines we're constrained to
@@ -226,6 +226,10 @@ type printer = @{
     mut pending_indentation: int
 };
 
+enum printer {
+    printer_(@printer_)
+}
+
 impl printer for printer {
     fn last_token() -> token { self.token[self.right] }
     // be very careful with this!