From ebe2c4bf3c1662b3667ce61fed54bde84afda615 Mon Sep 17 00:00:00 2001 From: paltherr Date: Fri, 3 Dec 2004 18:41:08 +0000 Subject: - Removed field units in class Global --- sources/scalac/ast/Tree.java.tmpl | 7 +++++-- sources/scalac/ast/printer/TreePrinter.java | 8 ++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sources/scalac/ast') diff --git a/sources/scalac/ast/Tree.java.tmpl b/sources/scalac/ast/Tree.java.tmpl index 0b130451fe..8a12c16577 100644 --- a/sources/scalac/ast/Tree.java.tmpl +++ b/sources/scalac/ast/Tree.java.tmpl @@ -14,6 +14,7 @@ import java.io.PrintWriter; import scala.tools.util.Position; import scalac.Global; +import scalac.ast.printer.TreePrinter; import scalac.checkers.CheckTreeNodes; import scalac.symtab.Symbol; import scalac.symtab.Type; @@ -111,8 +112,10 @@ public class Tree { /** Returns the string representation of this tree. */ public String toString() { StringWriter buffer = new StringWriter(); - Global global = Global.instance; - global.newTextTreePrinter(new PrintWriter(buffer)).print(this).flush(); + TreePrinter printer = + Global.instance.newTextTreePrinter(new PrintWriter(buffer)); + printer.print(this); + printer.flush(); return buffer.toString(); } diff --git a/sources/scalac/ast/printer/TreePrinter.java b/sources/scalac/ast/printer/TreePrinter.java index ce6ae2bd18..a0884b0b2a 100644 --- a/sources/scalac/ast/printer/TreePrinter.java +++ b/sources/scalac/ast/printer/TreePrinter.java @@ -23,10 +23,6 @@ public interface TreePrinter { public void end(); public void flush(); - public void print(Global global); - public void print(CompilationUnit unit); - - public TreePrinter print(Tree tree); - public TreePrinter print(String str); - public TreePrinter println(); + public void print(CompilationUnit[] units); + public void print(Tree tree); } -- cgit v1.2.3