summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-06-03 12:25:37 +0000
committerLex Spoon <lex@lexspoon.org>2007-06-03 12:25:37 +0000
commit724e68bab0d480fd9379afcbbb56ccc098770706 (patch)
treee43f183424ec9c02c261fb17a7dabdf18c84fea2 /src
parentae8da76c0141c0582577993ccfb24a3ad7f53d23 (diff)
downloadscala-724e68bab0d480fd9379afcbbb56ccc098770706.tar.gz
scala-724e68bab0d480fd9379afcbbb56ccc098770706.tar.bz2
scala-724e68bab0d480fd9379afcbbb56ccc098770706.zip
The parser no longer signals "incomplete input"...
The parser no longer signals "incomplete input" in cases where the input already has an outright syntax error.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala10
1 files changed, 9 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 51b53dff76..d81b31904c 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -92,6 +92,9 @@ trait Parsers {
private def stringVal = inName.toString
private def inNextTokenCode = in.next.token
+ /** whether a non-continuable error has been seen */
+ private var nonContinuableError = false
+
/** the markup parser */
def xmlp = {
if (xmlp0 == null)
@@ -178,6 +181,7 @@ trait Parsers {
skip()
in.skipping = false
}
+ nonContinuableError = true
}
def syntaxErrorMigrate(msg: String) =
@@ -190,7 +194,11 @@ trait Parsers {
}
def incompleteInputError(pos: ScanPosition, msg: String) {
- if (pos != in.errpos) {
+ if (pos == in.errpos) return
+
+ if (nonContinuableError)
+ syntaxError(pos, msg, false)
+ else {
in.incompleteInputError(pos, msg)
in.errpos = pos
}