diff options
author | Martin Odersky <odersky@gmail.com> | 2010-11-20 17:13:20 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-11-20 17:13:20 +0000 |
commit | 685f675ea0768c50b14be0cd1d5661179b390bd5 (patch) | |
tree | 5931dbf0a3689b27bf351ebcb1f5d0213a7efee4 | |
parent | 4886b55fa41e6c98434c90fe33a5909c5c935b5b (diff) | |
download | scala-685f675ea0768c50b14be0cd1d5661179b390bd5.tar.gz scala-685f675ea0768c50b14be0cd1d5661179b390bd5.tar.bz2 scala-685f675ea0768c50b14be0cd1d5661179b390bd5.zip |
A little IDE hardening
-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 5a63b49aac..751c7b5d13 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1501,7 +1501,9 @@ self => if (tok == EQUALS && eqOK) in.nextToken() else accept(LARROW) val rhs = expr() - enums += makeGenerator(r2p(start, point, in.lastOffset), pat, tok == EQUALS, rhs) + enums += makeGenerator(r2p(start, point, in.lastOffset max start), pat, tok == EQUALS, rhs) + // why max above? IDE stress tests have shown that lastOffset could be less than start, + // I guess this happens if instead if a for-expression we sit on a closing paren. while (in.token == IF) enums += makeFilter(in.offset, guard()) } |