@@ -9,13 +9,17 @@ import Symbols._
9
9
import config .Config
10
10
import config .Printers .{typr , default }
11
11
import util .Stats ._
12
- import ast .Trees ._
12
+ import ast .{tpd , Trees }
13
+ import Trees ._
13
14
14
15
class FrontEnd extends Phase {
16
+ import tpd ._
15
17
16
18
override def phaseName : String = FrontEnd .name
17
19
override def isTyper : Boolean = true
18
- import ast .tpd
20
+
21
+ // Run regardless of parsing errors
22
+ override def isRunnable (implicit ctx : Context ): Boolean = true
19
23
20
24
override def allowsImplicitSearch : Boolean = true
21
25
@@ -42,7 +46,7 @@ class FrontEnd extends Phase {
42
46
record(" retained typed trees after typer" , unit.tpdTree.treeSize)
43
47
}
44
48
45
- private def firstTopLevelDef (trees : List [tpd. Tree ])(implicit ctx : Context ): Symbol = trees match {
49
+ private def firstTopLevelDef (trees : List [Tree ])(implicit ctx : Context ): Symbol = trees match {
46
50
case PackageDef (_, defs) :: _ => firstTopLevelDef(defs)
47
51
case Import (_, _) :: defs => firstTopLevelDef(defs)
48
52
case (tree @ TypeDef (_, _)) :: _ => tree.symbol
@@ -58,14 +62,14 @@ class FrontEnd extends Phase {
58
62
ctx.fresh.setCompilationUnit(unit)
59
63
}
60
64
61
- record(" parsedTrees" , ast. Trees .ntrees)
65
+ record(" parsedTrees" , Trees .ntrees)
62
66
remaining = unitContexts
63
67
while (remaining.nonEmpty) {
64
68
enterSyms(remaining.head)
65
69
remaining = remaining.tail
66
70
}
67
71
unitContexts.foreach(typeCheck(_))
68
- record(" total trees after typer" , ast. Trees .ntrees)
72
+ record(" total trees after typer" , Trees .ntrees)
69
73
unitContexts.map(_.compilationUnit).filterNot(discardAfterTyper)
70
74
}
71
75
0 commit comments