Skip to content

Commit a0a9524

Browse files
committed
Rename.
1 parent 31de72c commit a0a9524

File tree

12 files changed

+30
-37
lines changed

12 files changed

+30
-37
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package dotc
33

44
import core._
55
import Contexts._
6-
import typer.{FrontEnd, RefChecks}
7-
import parsing.Parsing
6+
import typer.{TyperPhase, RefChecks}
7+
import parsing.Parser
88
import Phases.Phase
99
import transform._
1010
import dotty.tools.backend.jvm.{CollectSuperCalls, GenBCode}
@@ -37,8 +37,8 @@ class Compiler {
3737

3838
/** Phases dealing with the frontend up to trees ready for TASTY pickling */
3939
protected def frontendPhases: List[List[Phase]] =
40-
List(new Parsing) :: // Compiler frontend: scanner, parser
41-
List(new FrontEnd) :: // Compiler frontend: namer, typer
40+
List(new Parser) :: // Compiler frontend: scanner, parser
41+
List(new TyperPhase) :: // Compiler frontend: namer, typer
4242
List(new YCheckPositions) :: // YCheck positions
4343
List(new sbt.ExtractDependencies) :: // Sends information on classes' dependencies to sbt via callbacks
4444
List(new semanticdb.ExtractSemanticDB) :: // Extract info into .semanticdb files

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import util.Spans._, Types._, Contexts._, Constants._, Names._, NameOps._, Flags
77
import Symbols._, StdNames._, Trees._, Phases._, ContextOps._
88
import Decorators._, transform.SymUtils._
99
import NameKinds.{UniqueName, EvidenceParamName, DefaultGetterName}
10-
import typer.{FrontEnd, Namer, Checking}
10+
import typer.{TyperPhase, Namer, Checking}
1111
import util.{Property, SourceFile, SourcePosition}
1212
import config.Feature.{sourceVersion, migrateTo3, enabled}
1313
import config.SourceVersion._
@@ -1412,7 +1412,7 @@ object desugar {
14121412
def makeAnnotated(fullName: String, tree: Tree)(using Context): Annotated = {
14131413
val parts = fullName.split('.')
14141414
val ttree = typerPhase match {
1415-
case phase: FrontEnd if phase.stillToBeEntered(parts.last) =>
1415+
case phase: TyperPhase if phase.stillToBeEntered(parts.last) =>
14161416
val prefix =
14171417
parts.init.foldLeft(Ident(nme.ROOTPKG): Tree)((qual, name) =>
14181418
Select(qual, name.toTermName))

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ object Contexts {
388388
// to be used as a default value.
389389
compilationUnit != null && compilationUnit.isJava
390390

391-
/** Is current phase after FrontEnd? */
391+
/** Is current phase after TyperPhase? */
392392
final def isAfterTyper = base.isAfterTyper(phase)
393393
final def isTyper = base.isTyper(phase)
394394

compiler/src/dotty/tools/dotc/core/Phases.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import dotty.tools.dotc.core.Decorators.*
1414
import dotty.tools.dotc.core.DenotTransformers.*
1515
import dotty.tools.dotc.core.Denotations.*
1616
import dotty.tools.dotc.core.Periods.*
17-
import dotty.tools.dotc.parsing.Parsing
17+
import dotty.tools.dotc.parsing.Parser
1818
import dotty.tools.dotc.transform.*
1919
import dotty.tools.dotc.transform.MegaPhase.*
2020
import dotty.tools.dotc.typer.ImportInfo.withRootImports
21-
import dotty.tools.dotc.typer.{ FrontEnd, RefChecks }
21+
import dotty.tools.dotc.typer.{ TyperPhase, RefChecks }
2222

2323
object Phases {
2424

@@ -242,8 +242,8 @@ object Phases {
242242
private def setSpecificPhases() = {
243243
def phaseOfClass(pclass: Class[?]) = phases.find(pclass.isInstance).getOrElse(NoPhase)
244244

245-
myParserPhase = phaseOfClass(classOf[Parsing])
246-
myTyperPhase = phaseOfClass(classOf[FrontEnd])
245+
myParserPhase = phaseOfClass(classOf[Parser])
246+
myTyperPhase = phaseOfClass(classOf[TyperPhase])
247247
myPostTyperPhase = phaseOfClass(classOf[PostTyper])
248248
mySbtExtractDependenciesPhase = phaseOfClass(classOf[sbt.ExtractDependencies])
249249
myPicklerPhase = phaseOfClass(classOf[Pickler])
@@ -318,8 +318,8 @@ object Phases {
318318
*/
319319
def checkPostCondition(tree: tpd.Tree)(using Context): Unit = ()
320320

321-
/** Is this phase the standard typerphase? True for FrontEnd, but
322-
* not for other first phases (such as FromTasty). The predicate
321+
/** Is this phase the standard typerphase? True for TyperPhase, but
322+
* not for other first phases (such as FromTasty or Parser). The predicate
323323
* is tested in some places that perform checks and corrections. It's
324324
* different from ctx.isAfterTyper (and cheaper to test).
325325
*/

compiler/src/dotty/tools/dotc/interactive/InteractiveCompiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class InteractiveCompiler extends Compiler {
1313
// This could be improved by reporting errors back to the IDE
1414
// after each phase group instead of waiting for the pipeline to finish.
1515
override def phases: List[List[Phase]] = List(
16-
List(new Parsing),
17-
List(new FrontEnd),
16+
List(new Parser),
17+
List(new TyperPhase),
1818
List(new transform.SetRootTree),
1919
List(new transform.CookComments)
2020
)

compiler/src/dotty/tools/dotc/parsing/Parsing.scala renamed to compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,19 @@ import dotty.tools.dotc.config.Printers.{ default, typr }
66
import dotty.tools.dotc.core.Contexts.{ Context, ctx }
77
import dotty.tools.dotc.core.Phases.Phase
88
import dotty.tools.dotc.core.Symbols.defn
9-
import dotty.tools.dotc.parsing.JavaParsers.JavaParser
10-
import dotty.tools.dotc.parsing.Parsers.Parser
119
import dotty.tools.dotc.typer.ImportInfo.withRootImports
1210
import dotty.tools.dotc.{ CompilationUnit, ast, report }
1311
import dotty.tools.dotc.util.{ NoSourcePosition, SourcePosition }
1412
import dotty.tools.dotc.util.Stats.record
1513
import dotty.tools.unsupported
1614

17-
class Parsing extends Phase {
15+
class Parser extends Phase {
1816

1917
override def phaseName: String = "parsing"
2018

2119
// We run TreeChecker only after type checking
2220
override def isCheckable: Boolean = false
2321

24-
// TODO bad right?
25-
//override def allowsImplicitSearch: Boolean = false
26-
// TODO bad right?
27-
//override def isTyper: Boolean = true
28-
2922
override def isRunnable(implicit ctx: Context): Boolean = true
3023

3124
/** The position of the first XML literal encountered while parsing,
@@ -36,9 +29,9 @@ class Parsing extends Phase {
3629
def parse(using Context) = monitor("parsing") {
3730
val unit = ctx.compilationUnit
3831
unit.untpdTree =
39-
if (unit.isJava) new JavaParser(unit.source).parse()
32+
if (unit.isJava) new JavaParsers.JavaParser(unit.source).parse()
4033
else {
41-
val p = new Parser(unit.source)
34+
val p = new Parsers.Parser(unit.source)
4235
// p.in.debugTokenStream = true
4336
val tree = p.parse()
4437
if (p.firstXmlPos.exists && !firstXmlPos.exists)

compiler/src/dotty/tools/dotc/transform/Pickler.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ object Pickler {
2424
* only in backend.
2525
*/
2626
inline val ParallelPickling = true
27-
28-
private val counter = new java.util.concurrent.atomic.AtomicLong(0L)
2927
}
3028

3129
/** This phase pickles trees */

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ trait Checking {
795795
private def checkLegalImportOrExportPath(path: Tree, kind: String)(using Context): Unit = {
796796
checkStable(path.tpe, path.srcPos, kind)
797797
if (!ctx.isAfterTyper) Checking.checkRealizable(path.tpe, path.srcPos)
798-
if ((ctx.phase.isTyper && ctx.phase.isCheckable) || ctx.isAfterTyper) && !isIdempotentExpr(path) then
798+
if ctx.phase.isCheckable && !isIdempotentExpr(path) then
799799
report.error(em"import prefix is not a pure expression", path.srcPos)
800800
}
801801

compiler/src/dotty/tools/dotc/typer/FrontEnd.scala renamed to compiler/src/dotty/tools/dotc/typer/TyperPhase.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ import Decorators._
1010
import ImportInfo.withRootImports
1111
import parsing.JavaParsers.JavaParser
1212
import parsing.Parsers.Parser
13-
import parsing.Parsing
13+
import parsing.{Parser => ParserPhase}
1414
import config.Config
1515
import config.Printers.{typr, default}
1616
import util.Stats._
1717
import util.{ SourcePosition, NoSourcePosition }
1818
import scala.util.control.NonFatal
1919
import ast.Trees._
2020

21-
class FrontEnd extends Phase {
21+
class TyperPhase extends Phase {
2222

23-
override def phaseName: String = FrontEnd.name
23+
override def phaseName: String = TyperPhase.name
2424
override def isTyper: Boolean = true
2525
import ast.tpd
2626

@@ -86,7 +86,7 @@ class FrontEnd extends Phase {
8686
enterSyms(using remaining.head)
8787
remaining = remaining.tail
8888
val firstXmlPos = ctx.base.parserPhase match {
89-
case p: Parsing =>
89+
case p: ParserPhase =>
9090
if p.firstXmlPos.exists && !defn.ScalaXmlPackageClass.exists then
9191
report.error(
9292
"""To support XML literals, your project must depend on scala-xml.
@@ -111,6 +111,6 @@ class FrontEnd extends Phase {
111111
def run(using Context): Unit = unsupported("run")
112112
}
113113

114-
object FrontEnd {
114+
object TyperPhase {
115115
val name: String = "typer"
116116
}

compiler/src/dotty/tools/repl/ReplCompiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import dotty.tools.dotc.core.Symbols._
1414
import dotty.tools.dotc.reporting.Diagnostic
1515
import dotty.tools.dotc.transform.{PostTyper, Staging}
1616
import dotty.tools.dotc.typer.ImportInfo._
17-
import dotty.tools.dotc.typer.FrontEnd
17+
import dotty.tools.dotc.typer.TyperPhase
1818
import dotty.tools.dotc.util.Spans._
1919
import dotty.tools.dotc.util.{ParsedComment, SourceFile}
2020
import dotty.tools.dotc.{CompilationUnit, Compiler, Run}
@@ -33,7 +33,7 @@ import scala.collection.mutable
3333
class ReplCompiler extends Compiler {
3434

3535
override protected def frontendPhases: List[List[Phase]] = List(
36-
List(new FrontEnd),
36+
List(new TyperPhase),
3737
List(new CollectTopLevelImports),
3838
List(new PostTyper),
3939
)

docs/docs/contributing/testing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,5 @@ control.
169169

170170
Some of the tests depend on temporary state stored in the `out` directory. In rare cases, that directory
171171
can enter an inconsistent state and cause spurious test failures. If you suspect a spurious test failure,
172-
you can run `rm -rf out/*` from the root of the repository and run your tests again.
172+
you can run `rm -rf out/*` from the root of the repository and run your tests again. If that fails, you
173+
can try `git clean -xfd`.

docs/docs/internals/overall-structure.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ phases. The current list of phases is specified in class [Compiler] as follows:
9797

9898
/** Phases dealing with the frontend up to trees ready for TASTY pickling */
9999
protected def frontendPhases: List[List[Phase]] =
100-
List(new FrontEnd) :: // Compiler frontend: scanner, parser, namer, typer
100+
List(new Parser) :: // scanner, parser, namer, typer
101+
List(new TyperPhase) :: // namer, typer
101102
List(new YCheckPositions) :: // YCheck positions
102103
List(new sbt.ExtractDependencies) :: // Sends information on classes' dependencies to sbt via callbacks
103104
List(new semanticdb.ExtractSemanticDB) :: // Extract info into .semanticdb files

0 commit comments

Comments
 (0)