diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-27 15:48:39 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-27 15:48:39 +0000 |
commit | 228225c5387fb51c46faddd503a1d94b60a5a609 (patch) | |
tree | dbfc7b951ad05d5ae25405cf050a3284732f9d80 /src | |
parent | 7fe49aba49c3cdd1e01000c430f334777ede6d5c (diff) | |
download | scala-228225c5387fb51c46faddd503a1d94b60a5a609.tar.gz scala-228225c5387fb51c46faddd503a1d94b60a5a609.tar.bz2 scala-228225c5387fb51c46faddd503a1d94b60a5a609.zip |
Fix for #1749; removed some dead code related t...
Fix for #1749; removed some dead code related to regexp patterns.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 10 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala | 8 |
2 files changed, 2 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 73bed5c8e4..d992989879 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -99,7 +99,6 @@ trait Parsers extends NewScanners with MarkupParsers { final val SLASH: Name = "/" final val STAR : Name = "*" final val BAR : Name = "|" - final val OPT : Name = "?" final val LT : Name = "<" } @@ -1433,14 +1432,9 @@ trait Parsers extends NewScanners with MarkupParsers { def pattern3(seqOK: Boolean): Tree = { val base = opstack var top = simplePattern(seqOK) - if (seqOK && isIdent) { - if (inName == STAR) + if (seqOK && isIdent && inName == STAR) return atPos(inSkipToken)(Star(stripParens(top))) - else if (inName == PLUS) - return atPos(inSkipToken)(makePlus(stripParens(top))) - else if (inName == OPT) - return atPos(inSkipToken)(makeOpt(stripParens(top))) - } + while (isIdent && inName != BAR) { top = reduceStack( false, base, top, precedence(inName), treeInfo.isLeftAssoc(inName)) diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index c3ad63383b..ee32434612 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -363,14 +363,6 @@ abstract class TreeBuilder { Sequence(for (t <- ts; e <- elements(t)) yield e) } - /** Create tree for the p+ regex pattern, becomes p p* */ - def makePlus(p: Tree): Tree = - makeSequence(List(p, Star(p.duplicate))) - - /** Create tree for the p? regex pattern, becomes (p| ) */ - def makeOpt(p: Tree): Tree = - makeAlternative(List(p, Sequence(List()))) - /** Create visitor <x => x match cases> */ def makeVisitor(cases: List[CaseDef], checkExhaustive: Boolean): Tree = makeVisitor(cases, checkExhaustive, "x$") |