diff options
author | Som Snytt <som.snytt@gmail.com> | 2012-09-26 11:36:01 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2012-12-18 10:34:14 -0800 |
commit | fadb306fdf3d37284fd29c50aa3956cabe79480d (patch) | |
tree | 7389f4155de0aae885d6ade1bc82c80e99c8b52c /test/files/neg/t6446-additional | |
parent | e14917528e1c080a7f10785e21de36f3a7769718 (diff) | |
download | scala-fadb306fdf3d37284fd29c50aa3956cabe79480d.tar.gz scala-fadb306fdf3d37284fd29c50aa3956cabe79480d.tar.bz2 scala-fadb306fdf3d37284fd29c50aa3956cabe79480d.zip |
PluginComponent contributes description to -Xshow-phases.
In Global, SubComponent is called a phase descriptor, but it doesn't
actually have a description. (Phase itself does.) This fix adds
a description to PluginComponent so that plugins can describe what
they do in -Xshow-phases.
Elliptical descriptions
Exploded archives
Plugged-in partest
Roundup at the Little h!
Diffstat (limited to 'test/files/neg/t6446-additional')
-rw-r--r-- | test/files/neg/t6446-additional/ploogin_1.scala | 31 | ||||
-rw-r--r-- | test/files/neg/t6446-additional/sample_2.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6446-additional/sample_2.scala | 6 | ||||
-rw-r--r-- | test/files/neg/t6446-additional/scalac-plugin.xml | 4 |
4 files changed, 42 insertions, 0 deletions
diff --git a/test/files/neg/t6446-additional/ploogin_1.scala b/test/files/neg/t6446-additional/ploogin_1.scala new file mode 100644 index 0000000000..ed6adfc1cf --- /dev/null +++ b/test/files/neg/t6446-additional/ploogin_1.scala @@ -0,0 +1,31 @@ + +package t6446 + +import scala.tools.nsc.{ Global, Phase } +import scala.tools.nsc.plugins.{ Plugin, PluginComponent } +import scala.reflect.io.Path +import scala.reflect.io.File + +/** A test plugin. */ +class Ploogin(val global: Global) extends Plugin { + import global._ + + val name = "ploogin" + val description = "A sample plugin for testing." + val components = List[PluginComponent](TestComponent) + + private object TestComponent extends PluginComponent { + val global: Ploogin.this.global.type = Ploogin.this.global + //override val runsBefore = List("refchecks") + val runsAfter = List("jvm") + val phaseName = Ploogin.this.name + override def description = "A sample phase that does so many things it's kind of hard to describe briefly." + def newPhase(prev: Phase) = new TestPhase(prev) + class TestPhase(prev: Phase) extends StdPhase(prev) { + override def description = TestComponent.this.description + def apply(unit: CompilationUnit) { + // kewl kode + } + } + } +} diff --git a/test/files/neg/t6446-additional/sample_2.flags b/test/files/neg/t6446-additional/sample_2.flags new file mode 100644 index 0000000000..4d518c2286 --- /dev/null +++ b/test/files/neg/t6446-additional/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xshow-phases diff --git a/test/files/neg/t6446-additional/sample_2.scala b/test/files/neg/t6446-additional/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t6446-additional/sample_2.scala @@ -0,0 +1,6 @@ + +package sample + +// just a sample that is compiled with the sample plugin enabled +object Sample extends App { +} diff --git a/test/files/neg/t6446-additional/scalac-plugin.xml b/test/files/neg/t6446-additional/scalac-plugin.xml new file mode 100644 index 0000000000..e849bb5919 --- /dev/null +++ b/test/files/neg/t6446-additional/scalac-plugin.xml @@ -0,0 +1,4 @@ +<plugin> +<name>sample-plugin</name> +<classname>t6446.Ploogin</classname> +</plugin> |