diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-10-23 09:34:21 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-10-23 09:34:21 -0700 |
commit | b480d991072e6e68ed46574d87e4483da778ff0e (patch) | |
tree | e2a135df8f6ca1a92541edb75c2cc1bfc43f721e /src | |
parent | 2978812698a2ab34379830b18c93f7116681a706 (diff) | |
parent | cbad218dba47d49a39897b86d467c384538fdd53 (diff) | |
download | scala-b480d991072e6e68ed46574d87e4483da778ff0e.tar.gz scala-b480d991072e6e68ed46574d87e4483da778ff0e.tar.bz2 scala-b480d991072e6e68ed46574d87e4483da778ff0e.zip |
Merge pull request #1518 from retronym/ticket/2968
SI-2968 Fix brace healing for `^case (class|object) {`
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 5902209898..5b828ded79 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -283,10 +283,16 @@ trait Scanners extends ScannersCommon { prev copyFrom this val nextLastOffset = charOffset - 1 fetchToken() + def resetOffset() { + offset = prev.offset + lastOffset = prev.lastOffset + } if (token == CLASS) { token = CASECLASS + resetOffset() } else if (token == OBJECT) { token = CASEOBJECT + resetOffset() } else { lastOffset = nextLastOffset next copyFrom this |