Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b13d4e85 authored by Jack Palevich's avatar Jack Palevich
Browse files

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.
parent 1c60e46e
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -4537,10 +4537,9 @@ class Compiler : public ErrorSink {
    }
    }


    void skip(intptr_t c) {
    void skip(intptr_t c) {
        if (tok != c) {
        if (!accept(c)) {
            error("'%c' expected", c);
            error("'%c' expected", c);
        }
        }
        next();
    }
    }


    bool accept(intptr_t c) {
    bool accept(intptr_t c) {