From 7827c5ae1744583974f9c99432c1082ea6cb8997 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Wed, 3 Feb 2016 23:27:49 +0100 Subject: 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 --- src/dotty/tools/dotc/core/Contexts.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') 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 } -- cgit v1.2.3