summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-05-01 15:24:17 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-05-01 15:24:17 +0000
commit374bd7f7b064482eb8ca6ee0b513f89c11e31acc (patch)
tree313a6dc7e8251d40d52e531fa71b06463f85c010
parent570bb834c388537cebf049c5b30901866a978646 (diff)
downloadscala-374bd7f7b064482eb8ca6ee0b513f89c11e31acc.tar.gz
scala-374bd7f7b064482eb8ca6ee0b513f89c11e31acc.tar.bz2
scala-374bd7f7b064482eb8ca6ee0b513f89c11e31acc.zip
Fix for #773.
Problem was calling incompleteInputError multiple times would escalate the problem to be treated as a "real" error. This does not appear to be the correct semantics. Tried to fix this up as best as possible, but Sean needs to investigate the implications for the Eclipse plugin.
-rw-r--r--src/compiler/scala/tools/nsc/CompilationUnits.scala5
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala3
-rw-r--r--test/files/run/interpreter.check3
3 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/CompilationUnits.scala b/src/compiler/scala/tools/nsc/CompilationUnits.scala
index 68f5793a8b..2d2b849c90 100644
--- a/src/compiler/scala/tools/nsc/CompilationUnits.scala
+++ b/src/compiler/scala/tools/nsc/CompilationUnits.scala
@@ -65,11 +65,8 @@ trait CompilationUnits { self: Global =>
def incompleteInputError(pos: Position, msg:String) =
if (inIDE || !(errorPositions contains pos)) {
- val hadErrors = !errorPositions.isEmpty
- if (!hadErrors)
- reporter.incompleteInputError((pos), msg)
- else reporter.error((pos), msg)
if (!inIDE) errorPositions += pos
+ reporter.incompleteInputError((pos), msg)
}
override def toString() = source.toString()
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 00d16ffc01..78af57b191 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -256,6 +256,8 @@ trait Parsers extends NewScanners with MarkupParsers {
syntaxError(inCurrentPos, msg, skipIt)
}
// unused.
+ /* Commented out because the comment says it is unused.
+ Probably eliminate eventually. GAW 2008.05.01
def mismatch(expected: Int, found: Int) {
val posToReport = this.posToReport
val msg =
@@ -267,6 +269,7 @@ trait Parsers extends NewScanners with MarkupParsers {
else
syntaxError(posToReport, msg, true)
}
+ */
/** Consume one token of the specified type, or
* signal an error if it is not there.
diff --git a/test/files/run/interpreter.check b/test/files/run/interpreter.check
index 8ab8a7dd38..4689b659ba 100644
--- a/test/files/run/interpreter.check
+++ b/test/files/run/interpreter.check
@@ -142,9 +142,6 @@ scala>
scala> <console>:1: error: '=' expected but '=>' found.
def x => y => z
^
-<console>:1: error: illegal start of simple expression
- def x => y => z
- ^
scala> <console>:1: error: expected start of definition
[1,2,3]