summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/matching/MatchSupport.scala')
-rw-r--r--src/compiler/scala/tools/nsc/matching/MatchSupport.scala38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
index 07a79a174b..5ce1aabcd8 100644
--- a/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
+++ b/src/compiler/scala/tools/nsc/matching/MatchSupport.scala
@@ -22,8 +22,8 @@ trait MatchSupport extends ast.TreeDSL { self: ParallelMatching =>
def impossible: Nothing = abort("this never happens")
- // def treeCollect[T](tree: Tree, pf: PartialFunction[Tree, T]): List[T] =
- // tree filter (pf isDefinedAt _) map (x => pf(x))
+ def treeCollect[T](tree: Tree, pf: PartialFunction[Tree, T]): List[T] =
+ tree filter (pf isDefinedAt _) map (x => pf(x))
object Types {
import definitions._
@@ -36,24 +36,24 @@ trait MatchSupport extends ast.TreeDSL { self: ParallelMatching =>
// These tests for final classes can inspect the typeSymbol
private def is(s: Symbol) = tpe.typeSymbol eq s
- // def isByte = is(ByteClass)
- // def isShort = is(ShortClass)
+ def isByte = is(ByteClass)
+ def isShort = is(ShortClass)
def isInt = is(IntClass)
- // def isChar = is(CharClass)
- // def isBoolean = is(BooleanClass)
+ def isChar = is(CharClass)
+ def isBoolean = is(BooleanClass)
def isNothing = is(NothingClass)
- // def isArray = is(ArrayClass)
+ def isArray = is(ArrayClass)
}
}
object Debug {
- // def typeToString(t: Type): String = t match {
- // case NoType => "x"
- // case x => x.toString
- // }
- // def symbolToString(s: Symbol): String = s match {
- // case x => x.toString
- // }
+ def typeToString(t: Type): String = t match {
+ case NoType => "x"
+ case x => x.toString
+ }
+ def symbolToString(s: Symbol): String = s match {
+ case x => x.toString
+ }
def treeToString(t: Tree): String = treeInfo.unbind(t) match {
case EmptyTree => "?"
case WILD() => "_"
@@ -66,10 +66,10 @@ trait MatchSupport extends ast.TreeDSL { self: ParallelMatching =>
// Formatting for some error messages
private val NPAD = 15
def pad(s: String): String = "%%%ds" format (NPAD-1) format s
- // def pad(s: Any): String = pad(s match {
- // case x: Tree => treeToString(x)
- // case x => x.toString
- // })
+ def pad(s: Any): String = pad(s match {
+ case x: Tree => treeToString(x)
+ case x => x.toString
+ })
// pretty print for debugging
def pp(x: Any): String = pp(x, false)
@@ -117,7 +117,7 @@ trait MatchSupport extends ast.TreeDSL { self: ParallelMatching =>
else x
}
- // def indent(s: Any) = s.toString() split "\n" map (" " + _) mkString "\n"
+ def indent(s: Any) = s.toString() split "\n" map (" " + _) mkString "\n"
def indentAll(s: Seq[Any]) = s map (" " + _.toString() + "\n") mkString
}