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.
This commit is contained in:
Jack Palevich 2009-09-18 16:26:05 -07:00
parent 1c60e46e0e
commit b13d4e857a

View file

@ -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) {