diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2008-04-20 13:18:21 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2008-04-20 13:18:21 +0000 |
commit | baad2fbd4e0d013f65e0232ce0aaa534ade8bd40 (patch) | |
tree | 9cdd5f876d0942fe3dfe7f0f7b537ee655b2c8e4 | |
parent | c82c0adf093cdd3d6372806984df073e6307ff9a (diff) | |
download | scala-baad2fbd4e0d013f65e0232ce0aaa534ade8bd40.tar.gz scala-baad2fbd4e0d013f65e0232ce0aaa534ade8bd40.tar.bz2 scala-baad2fbd4e0d013f65e0232ce0aaa534ade8bd40.zip |
IDE bug fixes
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/io/SourceReader.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 9 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index f179639541..40da5f06c8 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2440,8 +2440,11 @@ trait Parsers extends NewScanners with MarkupParsers { * | */ def blockStatSeq(stats: ListBuffer[Tree]): List[Tree] = checkNoEscapingPlaceholders { - var last = false - while ((inToken != RBRACE) && (inToken != EOF) && (inToken != CASE) && !last) { + var keepGoing = true + var hasError = false + while ((inToken != RBRACE) && (inToken != EOF) && (inToken != CASE) && keepGoing) { + var hasError0 = hasError + hasError = false if (inToken == IMPORT) { stats ++= importClause() acceptStatSep() @@ -2458,6 +2461,7 @@ trait Parsers extends NewScanners with MarkupParsers { inNextToken } else { syntaxErrorOrIncomplete("illegal start of statement", true) + if (hasError0) keepGoing = false else hasError = true } } stats.toList diff --git a/src/compiler/scala/tools/nsc/io/SourceReader.scala b/src/compiler/scala/tools/nsc/io/SourceReader.scala index 4457a161fc..dcbe28e14f 100644 --- a/src/compiler/scala/tools/nsc/io/SourceReader.scala +++ b/src/compiler/scala/tools/nsc/io/SourceReader.scala @@ -46,6 +46,7 @@ class SourceReader(decoder: CharsetDecoder, reporter: Reporter) { read(c) } catch { case e:Exception => + if (true) e.printStackTrace reportEncodingError(file.toString()) new Array[Char](0) } finally { diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index b57b0ce2ef..24d6fb4f05 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -1322,8 +1322,13 @@ trait Symbols { def setLazyAccessor(sym: Symbol): TermSymbol = { // @S: in IDE setLazyAccessor can be called multiple times on same sym - assert(hasFlag(LAZY) && (referenced == NoSymbol || referenced == sym), this) - referenced = sym + if (inIDE && referenced != NoSymbol && referenced != sym) { + // do nothing + recycle(referenced) + } else { + assert(hasFlag(LAZY) && (referenced == NoSymbol || referenced == sym), this) + referenced = sym + } this } |