diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index 613928856d..37dea497fc 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -36,13 +36,19 @@ abstract class TreeBrowsers { def create(): SwingBrowser = new SwingBrowser(); + trait ValidTree extends Tree { + protected def initErrorCheck { + hasErrorTree = Some(false) + } + } + /** Pseudo tree class, so that all JTree nodes are treated uniformly */ - case class ProgramTree(units: List[UnitTree]) extends Tree { + case class ProgramTree(units: List[UnitTree]) extends ValidTree { override def toString(): String = "Program" } /** Pseudo tree class, so that all JTree nodes are treated uniformly */ - case class UnitTree(unit: CompilationUnit) extends Tree { + case class UnitTree(unit: CompilationUnit) extends ValidTree { override def toString(): String = unit.toString() } @@ -490,6 +496,9 @@ abstract class TreeBrowsers { case Star(t) => ("Star", EMPTY) + + case _: AbsErrorTree => + ("ErrorTree", EMPTY) } /** Return a list of children for the given tree node */ @@ -631,6 +640,9 @@ abstract class TreeBrowsers { case Star(t) => List(t) + + case _: AbsErrorTree => + Nil } /** Return a textual representation of this t's symbol */ |