diff options
author | Paul Phillips <paulp@improving.org> | 2010-05-19 04:08:02 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-05-19 04:08:02 +0000 |
commit | 4d11985231229984fd207dcd633d070ff24c97fb (patch) | |
tree | d06625b2a121595281d5b7818ea2f7bb5976a3cf /src/compiler | |
parent | ebfcab7b96e95939e3f258f27e936844e343326a (diff) | |
download | scala-4d11985231229984fd207dcd633d070ff24c97fb.tar.gz scala-4d11985231229984fd207dcd633d070ff24c97fb.tar.bz2 scala-4d11985231229984fd207dcd633d070ff24c97fb.zip |
Hacky but no-risk fix for #3189, which was caus...
Hacky but no-risk fix for #3189, which was caused by the ghost of
regular expression patterns rising from the grave to haunt the parser.
No review.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 868a8c0dd4..8e9af3c341 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1486,7 +1486,9 @@ self => def pattern3(seqOK: Boolean): Tree = { val base = opstack var top = simplePattern(seqOK) - if (seqOK && isIdent && in.name == STAR) + // See ticket #3189 for the motivation for the null check. + // TODO: dredge out the remnants of regexp patterns. + if (seqOK && isIdent && in.name == STAR && in.prev.name != null) return atPos(top.pos.startOrPoint, in.skipToken())(Star(stripParens(top))) while (isIdent && in.name != BAR) { |