Pass symbol on top of stack to nextToken

This commit is contained in:
2025-05-13 12:29:48 -04:00
parent 557e89f1a2
commit 496fb229ec

View File

@@ -511,9 +511,10 @@ private:
if (self->empty()) {
return true;
}
auto token = self->nextToken();
auto top = *(self->stackPtr - 1);
auto token = self->nextToken(top);
// self->debugPrint(token);
MUSTTAIL return table[*(self->stackPtr - 1)][token](self);
MUSTTAIL return table[top][token](self);
}
static bool reject(Parser2 *self) {
@@ -768,7 +769,7 @@ private:
};
const char *bufBefore;
Symbol nextToken() {
Symbol nextToken(Symbol expected) {
maybeSkipWs();
bufBefore = buf;
if (len == 0) {