From b13d4e857a761d42ebbaece2bafd7799c875686e Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Fri, 18 Sep 2009 16:26:05 -0700 Subject: [PATCH] Improve error-handling when an expected token is missing. We had been arbitrarily swallowing the next token, even if it wasn't the one we were expecting. Now we only swallow it if it _is_ the one we were expecting. --- libacc/acc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libacc/acc.cpp b/libacc/acc.cpp index 436f80697..6d9213c74 100644 --- a/libacc/acc.cpp +++ b/libacc/acc.cpp @@ -4537,10 +4537,9 @@ class Compiler : public ErrorSink { } void skip(intptr_t c) { - if (tok != c) { + if (!accept(c)) { error("'%c' expected", c); } - next(); } bool accept(intptr_t c) {