diff options
Diffstat (limited to 'src/continuations/plugin')
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/CPSUtils.scala | 2 | ||||
-rw-r--r-- | src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/CPSUtils.scala b/src/continuations/plugin/scala/tools/selectivecps/CPSUtils.scala index 67ea6e15f0..6f5284f75f 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/CPSUtils.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/CPSUtils.scala @@ -9,7 +9,7 @@ trait CPSUtils { import global._ import definitions._ - var cpsEnabled = true + var cpsEnabled = false val verbose: Boolean = System.getProperty("cpsVerbose", "false") == "true" def vprintln(x: =>Any): Unit = if (verbose) println(x) diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala index eb18f03748..8a500d6c4d 100644 --- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala +++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveCPSPlugin.scala @@ -26,6 +26,7 @@ class SelectiveCPSPlugin(val global: Global) extends Plugin { override val runsBefore = List("uncurry") } + val components = List[PluginComponent](anfPhase, cpsPhase) val checker = new CPSAnnotationChecker { @@ -42,17 +43,19 @@ class SelectiveCPSPlugin(val global: Global) extends Plugin { } // TODO: require -enabled command-line flag + override def processOptions(options: List[String], error: String => Unit) = { - var enabled = true - options foreach { - case "enable" => enabled = true - case "disable" => enabled = false - case option => error("Option not understood: "+option) + var enabled = false + for (option <- options) { + if (option == "enable") { + enabled = true + } else { + error("Option not understood: "+option) + } } setEnabled(enabled) } - override val optionsHelp: Option[String] = { - Some(" -P:continuations:disable Disable continuations plugin") - } + override val optionsHelp: Option[String] = + Some(" -P:continuations:enable Enable continuations") } |