Skip to content
Snippets Groups Projects
Commit dede3cc1 authored by Philippe Suter's avatar Philippe Suter
Browse files

purescala is now independent from the plugin... good for us if we ever want another front-end

parent e16a177c
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,6 @@ import scalacheck._ ...@@ -6,7 +6,6 @@ import scalacheck._
class AnalysisComponent(val global: Global, val pluginInstance: FunCheckPlugin) class AnalysisComponent(val global: Global, val pluginInstance: FunCheckPlugin)
extends PluginComponent extends PluginComponent
with NameAnalyzer
with CodeExtraction with CodeExtraction
// with ScalaCheckIntegrator // Mirco's stuff. // with ScalaCheckIntegrator // Mirco's stuff.
{ {
......
...@@ -26,7 +26,7 @@ trait CodeExtraction extends Extractors { ...@@ -26,7 +26,7 @@ trait CodeExtraction extends Extractors {
case None => stopIfErrors; scala.Predef.error("unreachable error.") case None => stopIfErrors; scala.Predef.error("unreachable error.")
} }
def st2ps(tree: Tree): funcheck.purescala.TypeTrees.TypeTree = toPureScalaType(unit)(tree) match { def st2ps(tree: Tree): purescala.TypeTrees.TypeTree = toPureScalaType(unit)(tree) match {
case Some(tt) => tt case Some(tt) => tt
case None => stopIfErrors; scala.Predef.error("unreachable error.") case None => stopIfErrors; scala.Predef.error("unreachable error.")
} }
...@@ -140,7 +140,7 @@ trait CodeExtraction extends Extractors { ...@@ -140,7 +140,7 @@ trait CodeExtraction extends Extractors {
} }
} }
def toPureScalaType(unit: CompilationUnit)(typeTree: Tree): Option[funcheck.purescala.TypeTrees.TypeTree] = { def toPureScalaType(unit: CompilationUnit)(typeTree: Tree): Option[purescala.TypeTrees.TypeTree] = {
try { try {
Some(scalaType2PureScala(unit, false)(typeTree)) Some(scalaType2PureScala(unit, false)(typeTree))
} catch { } catch {
...@@ -180,7 +180,7 @@ trait CodeExtraction extends Extractors { ...@@ -180,7 +180,7 @@ trait CodeExtraction extends Extractors {
rec(tree) rec(tree)
} }
private def scalaType2PureScala(unit: CompilationUnit, silent: Boolean)(tree: Tree): funcheck.purescala.TypeTrees.TypeTree = { private def scalaType2PureScala(unit: CompilationUnit, silent: Boolean)(tree: Tree): purescala.TypeTrees.TypeTree = {
tree match { tree match {
case tt: TypeTree if tt.tpe == IntClass.tpe => Int32Type case tt: TypeTree if tt.tpe == IntClass.tpe => Int32Type
case tt: TypeTree if tt.tpe == BooleanClass.tpe => BooleanType case tt: TypeTree if tt.tpe == BooleanClass.tpe => BooleanType
......
package funcheck
import scala.tools.nsc._
import scala.tools.nsc.plugins._
import purescala.Definitions._
import purescala.Trees._
import purescala.TypeTrees._
import purescala.Common._
trait NameAnalyzer extends Extractors {
self: AnalysisComponent =>
import global._
import StructuralExtractors._
def collectNames(unit: CompilationUnit): Unit = {
}
}
package funcheck.purescala package purescala
object Common { object Common {
type Identifier = String type Identifier = String
......
package funcheck.purescala package purescala
object Definitions { object Definitions {
import Common._ import Common._
......
package funcheck.purescala package purescala
/** This pretty-printer uses Unicode for some operators, to make sure we /** This pretty-printer uses Unicode for some operators, to make sure we
......
package funcheck.purescala package purescala
/** AST definitions for Pure Scala. */ /** AST definitions for Pure Scala. */
object Trees { object Trees {
......
package funcheck.purescala package purescala
object TypeTrees { object TypeTrees {
import Common._ import Common._
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment