diff options
author | buraq <buraq@epfl.ch> | 2005-06-20 17:40:05 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2005-06-20 17:40:05 +0000 |
commit | bc84a838e59aa244dd982fa1bb6e2b79da85f569 (patch) | |
tree | ed71e642504505362c805e86ece8ae2593b1ad0e | |
parent | df6b358dcb3bbcbcb4911528373a4aeb25daffc4 (diff) | |
download | scala-bc84a838e59aa244dd982fa1bb6e2b79da85f569.tar.gz scala-bc84a838e59aa244dd982fa1bb6e2b79da85f569.tar.bz2 scala-bc84a838e59aa244dd982fa1bb6e2b79da85f569.zip |
transmatch
-rwxr-xr-x | sources/scala/tools/nsc/Global.scala | 12 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/Main.scala | 2 | ||||
-rw-r--r-- | sources/scala/tools/nsc/matching/TransMatcher.scala | 5 |
3 files changed, 13 insertions, 6 deletions
diff --git a/sources/scala/tools/nsc/Global.scala b/sources/scala/tools/nsc/Global.scala index 3545d18b5d..b914b95e80 100755 --- a/sources/scala/tools/nsc/Global.scala +++ b/sources/scala/tools/nsc/Global.scala @@ -16,7 +16,7 @@ import util._; import ast._; import ast.parser._; import typechecker._; -//import matching._; +import matching.TransMatcher; import transform._; class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable with Trees with CompilationUnits { @@ -170,10 +170,12 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable } val uncurryPhase = new uncurry.Phase(refchecksPhase); - //object transmatcher extends TransMatcher { - // val global: Global.this.type = Global.this; - //} + object transmatcher extends TransMatcher { + val global: Global.this.type = Global.this; + + } + val transMatchPhase = new transmatcher.Phase(uncurryPhase); //object typesAsValues extends TypesAsValues { // val global: Global.this.type = Global.this; //} @@ -181,7 +183,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable object sampleTransform extends SampleTransform { val global: Global.this.type = Global.this; } - val samplePhase = new sampleTransform.Phase(uncurryPhase); + val samplePhase = new sampleTransform.Phase(transMatchPhase); //val transMatchPhase = new transmatcher.TransMatchPhase(picklePhase); /* diff --git a/sources/scala/tools/nsc/Main.scala b/sources/scala/tools/nsc/Main.scala index b761e609cc..c29f097bfe 100755 --- a/sources/scala/tools/nsc/Main.scala +++ b/sources/scala/tools/nsc/Main.scala @@ -26,6 +26,8 @@ object Main { reporter.error(new Position(PRODUCT), msg + "\n " + PRODUCT + " -help gives more information"); + def errors() = reporter.errors(); + def interactive(compiler: Global): unit = { val in = new BufferedReader(new InputStreamReader(System.in)); System.out.print(prompt); diff --git a/sources/scala/tools/nsc/matching/TransMatcher.scala b/sources/scala/tools/nsc/matching/TransMatcher.scala index 869e706d63..6986c6de83 100644 --- a/sources/scala/tools/nsc/matching/TransMatcher.scala +++ b/sources/scala/tools/nsc/matching/TransMatcher.scala @@ -68,10 +68,12 @@ with RightTracers { } - var cunit: CompilationUnit; + var cunit: CompilationUnit = _; def fresh = cunit.fresh ; + var owner: Symbol = _; + def containsBinding(pat: Tree): Boolean = { var generatedVars = false; @@ -215,6 +217,7 @@ with RightTracers { val owner = currentOwner; val selector = sel ; } + TransMatcher.this.owner = currentOwner; // @todo: remove from partial matcher //new AlgebraicMatcher() { // val tm: TransMatcher.this.type = TransMatcher.this; //}.construct( matcher, ncases ); |