summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2005-11-03 15:02:29 +0000
committerBurak Emir <emir@epfl.ch>2005-11-03 15:02:29 +0000
commitfeaeff1c3c93269bdacca19bc83c613e936f909f (patch)
treed9c5914ea299bd9709ba22332c0089e4e9c49195
parenta41b58e5a1125a3fd67be575c66040bfb2deb599 (diff)
downloadscala-feaeff1c3c93269bdacca19bc83c613e936f909f.tar.gz
scala-feaeff1c3c93269bdacca19bc83c613e936f909f.tar.bz2
scala-feaeff1c3c93269bdacca19bc83c613e936f909f.zip
update patmat
-rw-r--r--sources/scala/tools/nsc/matching/CodeFactory.scala16
-rw-r--r--sources/scala/tools/nsc/matching/PatternMatchers.scala1
-rw-r--r--sources/scala/tools/nsc/matching/TransMatcher.scala2
3 files changed, 12 insertions, 7 deletions
diff --git a/sources/scala/tools/nsc/matching/CodeFactory.scala b/sources/scala/tools/nsc/matching/CodeFactory.scala
index 0bf42a838e..387aa6fd14 100644
--- a/sources/scala/tools/nsc/matching/CodeFactory.scala
+++ b/sources/scala/tools/nsc/matching/CodeFactory.scala
@@ -141,6 +141,7 @@ import scala.tools.util.Position;
}
// used by Equals
+/*
private def getEqEq(left: Type, right: Type): Symbol = {
//Console.println("getEqeq of left == "+left);
val sym = left.nonPrivateMember( nme.EQEQ );
@@ -175,10 +176,12 @@ import scala.tools.util.Position;
//if (fun == null) scala.Predef.error("couldn't find eqeq for left"+left);
fun;
}
-
- def Equals(left1:Tree , right1:Tree ): Tree = {
- var left = left1;
- var right = right1;
+*/
+ def Equals(left: Tree , right: Tree ): Tree = Apply(Select(left, nme.EQEQ), List(right));
+/* { var left = left1;
+ var right = right1;
+*/
+/*
//Console.println("CodeFactory:: left.tpe =" + left.tpe + " right.tpe "+right.tpe+")");
val ltype = left.tpe.widen;
var rtype = right.tpe.widen;
@@ -193,10 +196,11 @@ import scala.tools.util.Position;
rtype = definitions.IntClass.info;
}
val eqsym = getEqEq(ltype, rtype);
+*/
//Console.println("eqsym "+eqsym);
//Console.println("eqsym.tpe "+eqsym.tpe);
- Apply(Select(left, eqsym), List(right));
- }
+// Apply(Select(left1, nme.EQEQ/*eqsym*/), List(right1));
+// }
def ThrowMatchError(pos: Int, tpe: Type ) =
Apply(
diff --git a/sources/scala/tools/nsc/matching/PatternMatchers.scala b/sources/scala/tools/nsc/matching/PatternMatchers.scala
index a87ef728f2..30ac08a966 100644
--- a/sources/scala/tools/nsc/matching/PatternMatchers.scala
+++ b/sources/scala/tools/nsc/matching/PatternMatchers.scala
@@ -530,6 +530,7 @@ trait PatternMatchers: (TransMatcher with PatternNodes) extends AnyRef with Patt
case class Break(res:Boolean) extends java.lang.Throwable;
case class Break2() extends java.lang.Throwable;
+ // TODO disentangle this
protected def isSimpleSwitch(): Boolean = {
print();
var patNode = root.and;
diff --git a/sources/scala/tools/nsc/matching/TransMatcher.scala b/sources/scala/tools/nsc/matching/TransMatcher.scala
index 5d7bb9de86..b811385ed3 100644
--- a/sources/scala/tools/nsc/matching/TransMatcher.scala
+++ b/sources/scala/tools/nsc/matching/TransMatcher.scala
@@ -253,7 +253,7 @@ with RightTracers {
}
override def transform(tree: Tree): Tree = tree match {
case Match(selector, cases) =>
- val nselector = transform(selector).setType(selector.tpe);
+ val nselector = transform(selector).setType(selector.tpe);
val ncases = cases map { transform };
/*
Console.println("TransMatch translating cases: ");