diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-14 16:07:59 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-14 16:07:59 +0200 |
commit | f19250b1a123aa63cf8f14096bfd8e29e7e548b2 (patch) | |
tree | a676a2d5c8e3dc494c4736c9d1454294b9b10341 /src/dotty/tools/dotc/Compiler.scala | |
parent | c6f0c00790c996bea57ea905a830dedcb4f2bb44 (diff) | |
download | dotty-f19250b1a123aa63cf8f14096bfd8e29e7e548b2.tar.gz dotty-f19250b1a123aa63cf8f14096bfd8e29e7e548b2.tar.bz2 dotty-f19250b1a123aa63cf8f14096bfd8e29e7e548b2.zip |
Integrated parser/typer into compiler
Some initial bug fixes.
Added -explaintypes diagnostics.
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index f5bf1fb9b..e094cc06c 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -3,9 +3,22 @@ package dotc import core._ import Contexts._ +import Periods._ +import Symbols._ +import typer.{FrontEnd, Typer} class Compiler { - def newRun(implicit ctx: Context): Run = new Run(this) + def phases = List(new FrontEnd) + def rootContext(implicit ctx: Context): Context = { + ctx.usePhases(phases) + ctx.fresh + .withPeriod(Period(ctx.runId + 1, FirstPhaseId)) + .withOwner(defn.RootClass) + .withTyper(new Typer) + } + + def newRun(implicit ctx: Context): Run = + new Run(this)(rootContext) }
\ No newline at end of file |