diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-02-03 23:27:49 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-02-04 23:31:03 +0100 |
commit | 7827c5ae1744583974f9c99432c1082ea6cb8997 (patch) | |
tree | d89a95b4653e5ed468fd73985d65b86ebea18f25 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | 208f7cde44a06947e452ba6c5132704caa4b1c3e (diff) | |
download | dotty-7827c5ae1744583974f9c99432c1082ea6cb8997.tar.gz dotty-7827c5ae1744583974f9c99432c1082ea6cb8997.tar.bz2 dotty-7827c5ae1744583974f9c99432c1082ea6cb8997.zip |
Better compiler entry points
- Document the entry points
- It is now possible to set a custom reporter without using a custom
context
- Use `null` for optional arguments to make it easier to run the
compiler using reflection or from Java.
- DPDirectCompiler does not use a custom context anymore
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 14e8ccb52..f7af6f43e 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -427,6 +427,7 @@ object Contexts { def setPeriod(period: Period): this.type = { this.period = period; this } def setMode(mode: Mode): this.type = { this.mode = mode; this } def setTyperState(typerState: TyperState): this.type = { this.typerState = typerState; this } + def setReporter(reporter: Reporter): this.type = setTyperState(typerState.withReporter(reporter)) def setNewTyperState: this.type = setTyperState(typerState.fresh(isCommittable = true)) def setExploreTyperState: this.type = setTyperState(typerState.fresh(isCommittable = false)) def setPrinterFn(printer: Context => Printer): this.type = { this.printerFn = printer; this } |