diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-08-29 17:52:02 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 14:39:07 +0200 |
commit | f9d5e3d4e8cca61ee75072ab13c2935061a1850e (patch) | |
tree | c96fe138c69a5d49f9485a1424b9b72b41282c65 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | c637cfc01cb8258d47094fc79313a76bfdd5d268 (diff) | |
download | scala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.tar.gz scala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.tar.bz2 scala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.zip |
SI-7196 add support for refineStat splicing and extraction
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 20 |
1 files changed, 12 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 e5101a27a8..158fa147b6 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -3012,19 +3012,23 @@ self => def refineStatSeq(): List[Tree] = checkNoEscapingPlaceholders { val stats = new ListBuffer[Tree] while (!isStatSeqEnd) { - if (isDclIntro) { // don't IDE hook - stats ++= joinComment(defOrDcl(in.offset, NoMods)) - } else if (!isStatSep) { - syntaxErrorOrIncomplete( - "illegal start of declaration"+ - (if (inFunReturnType) " (possible cause: missing `=' in front of current method body)" - else ""), skipIt = true) - } + stats ++= refineStat() if (in.token != RBRACE) acceptStatSep() } stats.toList } + def refineStat(): List[Tree] = + if (isDclIntro) { // don't IDE hook + joinComment(defOrDcl(in.offset, NoMods)) + } else if (!isStatSep) { + syntaxErrorOrIncomplete( + "illegal start of declaration"+ + (if (inFunReturnType) " (possible cause: missing `=' in front of current method body)" + else ""), skipIt = true) + Nil + } else Nil + /** overridable IDE hook for local definitions of blockStatSeq * Here's an idea how to fill in start and end positions. def localDef : List[Tree] = { |