summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2005-06-03 15:32:25 +0000
committerburaq <buraq@epfl.ch>2005-06-03 15:32:25 +0000
commit336f08db481ffae50434bf03248d0adbb0767713 (patch)
treeadb0311894c273c1a8f0e817f7e3bc50829817aa /sources
parent4751d1277492daecabf0a676b66818cfdec93ff3 (diff)
downloadscala-336f08db481ffae50434bf03248d0adbb0767713.tar.gz
scala-336f08db481ffae50434bf03248d0adbb0767713.tar.bz2
scala-336f08db481ffae50434bf03248d0adbb0767713.zip
obso, put utility fun in transmatcher, where ev...
obso, put utility fun in transmatcher, where everybody sees it
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/nsc/matching/PatternUtil.scala78
1 files changed, 0 insertions, 78 deletions
diff --git a/sources/scala/tools/nsc/matching/PatternUtil.scala b/sources/scala/tools/nsc/matching/PatternUtil.scala
deleted file mode 100644
index 475446eb56..0000000000
--- a/sources/scala/tools/nsc/matching/PatternUtil.scala
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ____ ____ ____ ____ ______ *\
-** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
-** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002-2005, LAMP/EPFL **
-** /_____/\____/\___/\____/____/ **
-** **
-\* */
-
-// $Id$
-
-package scala.tools.nsc.matching;
-
-import scala.tools.util.Position;
-
-/** utility functions
- */
-abstract class PatternUtil {
-/*
- val global: Global;
-
- import global._;
-
- var pos: Position;
-
- var unit: CompilationUnit = _;
-
- import global.definitions;
-
- def containsBinding(pat: Tree): Boolean = {
- var generatedVars = false;
-
- def handleVariableSymbol(sym: Symbol): Unit =
- if (sym.name.toString().indexOf("$") == -1) {
- generatedVars = true; // .add(sym);
- }
-
- def isVariableName(name: Name): Boolean =
- ( treeInfo.isVariableName(name) ) && ( name != nme.USCOREkw ) ;
-
- def isVariableSymbol(sym: Symbol): Boolean =
- ( sym != null )&&( !sym.isPrimaryConstructor );
-
- def traverse(tree: Tree): Unit = {
-
- tree match {
- case x @ Ident(name) =>
- if(x.symbol != definitions.PatternWildcard)
- error("shouldn't happen?!");
-
- case Bind(name, subtree) =>
- var sym: Symbol = _;
-
- if (isVariableName(name)
- && isVariableSymbol( {sym = tree.symbol; tree.symbol} ))
- handleVariableSymbol(sym);
-
- traverse( subtree );
-
- // congruence
-
- case Apply(fun, args) => args foreach traverse;
- case Sequence(trees) => trees foreach traverse
- case Star(arg) => traverse(arg)
- case Typed(expr, tpe) => traverse(expr); // needed??
-
- case _ : Select |
- _ : Alternative |
- _ : Select |
- _ : Literal => ; // no variables
-
- case _ =>
- error("unknown pattern node:" + tree + " = " + tree.getClass());
- }
- }
- traverse(pat);
- generatedVars;
- }
-*/
-} // class PatternUtil