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 /test | |
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 'test')
-rw-r--r-- | test/dotty/partest/DPDirectCompiler.scala | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/dotty/partest/DPDirectCompiler.scala b/test/dotty/partest/DPDirectCompiler.scala index 4e563820f..410dac338 100644 --- a/test/dotty/partest/DPDirectCompiler.scala +++ b/test/dotty/partest/DPDirectCompiler.scala @@ -13,20 +13,14 @@ class DPDirectCompiler(runner: DPTestRunner) extends nest.DirectCompiler(runner) val clogWriter = new PrintWriter(clogFWriter, true) clogWriter.println("\ncompiling " + sources.mkString(" ") + "\noptions: " + opts0.mkString(" ")) - implicit val ctx: dotty.tools.dotc.core.Contexts.Context = { - val base = new dotty.tools.dotc.core.Contexts.ContextBase - base.initialCtx.fresh - } - try { val processor = if (opts0.exists(_.startsWith("#"))) dotty.tools.dotc.Bench else dotty.tools.dotc.Main val clogger = new ConsoleReporter(writer = clogWriter) - val logCtx = ctx.fresh.setTyperState(ctx.typerState.withReporter(clogger)) - val reporter = processor.process((sources.map(_.toString) ::: opts0).toArray, logCtx) + val reporter = processor.process((sources.map(_.toString) ::: opts0).toArray, clogger) if (!reporter.hasErrors) runner.genPass() else { - reporter.printSummary(ctx) + clogWriter.println(reporter.summary) runner.genFail(s"compilation failed with ${reporter.errorCount} errors") } } catch { |