diff options
author | Burak Emir <emir@epfl.ch> | 2006-03-14 16:45:24 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-03-14 16:45:24 +0000 |
commit | bdc6a260fb87c354e5ab9465c8fed13c533c2205 (patch) | |
tree | 93e80e8e5d2cd8170c9818c4d2010e0436f29950 /src | |
parent | 803caf64eeb63d644a51558298d3c0ac1ee17b42 (diff) | |
download | scala-bdc6a260fb87c354e5ab9465c8fed13c533c2205.tar.gz scala-bdc6a260fb87c354e5ab9465c8fed13c533c2205.tar.bz2 scala-bdc6a260fb87c354e5ab9465c8fed13c533c2205.zip |
disabling sequence pattern parsing (a,b)
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index b31d99e528..f6731cf37e 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -988,10 +988,10 @@ trait Parsers requires SyntaxAnalyzer { * | `_' `:' Type1 * | [SeqPattern2] */ - def pattern1(seqOK: boolean): Tree = - if (seqOK && !isExprIntro) { - atPos(in.currentPos) { Sequence(List()) } - } else { + def pattern1(seqOK: boolean): Tree = { + //if (false && /*disabled, no regexp matching*/ seqOK && !isExprIntro) { + //atPos(in.currentPos) { Sequence(List()) } + //} else { val p = pattern2(seqOK); p match { case Ident(name) if (treeInfo.isVariableName(name) && in.token == COLON) => @@ -999,7 +999,8 @@ trait Parsers requires SyntaxAnalyzer { case _ => p } - } + //} + } /* Pattern2 ::= varid [ @ Pattern3 ] * | Pattern3 @@ -1089,8 +1090,9 @@ trait Parsers requires SyntaxAnalyzer { case LPAREN => val pos = in.skipToken(); val p = - if (seqOK) atPos(pos) { makeSequence(patterns()) } - else if (in.token != RPAREN) pattern(false); + //if (false /*disabled, no regexp matching*/ && seqOK) atPos(pos) { makeSequence(patterns()) } + //else + if (in.token != RPAREN) pattern(false); else Literal(()).setPos(pos); accept(RPAREN); p @@ -1628,7 +1630,7 @@ trait Parsers requires SyntaxAnalyzer { atPos(in.currentPos) { def acceptEmptyTemplateBody(msg: String): unit = { if (in.token == LPAREN && settings.migrate.value) - syntaxErrorMigrate("mixin classes may not have parameters"); + syntaxErrorMigrate("traites may not have parameters"); if (!(in.token == SEMI || in.token == NEWLINE || in.token == COMMA || in.token == RBRACE || in.token == EOF)) syntaxError(msg, true); |