summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scalac/Unit.java2
-rw-r--r--sources/scalac/atree/ATreePrinter.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/sources/scalac/Unit.java b/sources/scalac/Unit.java
index a57aab9f8a..db127fd48a 100644
--- a/sources/scalac/Unit.java
+++ b/sources/scalac/Unit.java
@@ -13,6 +13,7 @@ import ch.epfl.lamp.util.Position;
import scalac.symtab.NameMangler;
import scalac.ast.Tree;
+import scalac.atree.ARepository;
import java.util.HashMap;
@@ -38,6 +39,7 @@ public class Unit {
/** the content of the compilation unit in tree form
*/
public Tree[] body;
+ public ARepository repository;
/** the name mangler
*/
diff --git a/sources/scalac/atree/ATreePrinter.java b/sources/scalac/atree/ATreePrinter.java
index 971ede91ac..779a6c853e 100644
--- a/sources/scalac/atree/ATreePrinter.java
+++ b/sources/scalac/atree/ATreePrinter.java
@@ -237,6 +237,12 @@ public class ATreePrinter {
//########################################################################
// Public Methods - Printing trees
+ /** Prints the unit. */
+ public ATreePrinter printUnit(Unit unit) {
+ println("// Scala source: " + unit.source);
+ return printRepository(unit.repository);
+ }
+
/** Prints the repository. */
public ATreePrinter printRepository(ARepository repository) {
AClass[] classes = repository.classes();