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