commit | b13d4e857a761d42ebbaece2bafd7799c875686e | [log] [tgz] |
---|---|---|
author | Jack Palevich <jackpal@google.com> | Fri Sep 18 16:26:05 2009 -0700 |
committer | Jack Palevich <jackpal@google.com> | Fri Sep 18 16:26:05 2009 -0700 |
tree | 57b7867cba689f2eba3531dbd19ebe79fc7ea90a | |
parent | 1c60e46e0e5a20426e235eaede8f1cf7395f4cc0 [diff] |
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.
diff --git a/libacc/acc.cpp b/libacc/acc.cpp index 436f806..6d9213c 100644 --- a/libacc/acc.cpp +++ b/libacc/acc.cpp
@@ -4537,10 +4537,9 @@ } void skip(intptr_t c) { - if (tok != c) { + if (!accept(c)) { error("'%c' expected", c); } - next(); } bool accept(intptr_t c) {