core: lexer: Fix up whitespace skipping

Signed-off-by: Chloe M. <chloe@mirocom.org>
This commit is contained in:
2026-05-23 08:08:48 -04:00
parent 9bc47590c3
commit 50bd6324fe
+6 -2
View File
@@ -73,13 +73,17 @@ lexer_consume_single(struct cescal_state *state, bool skip_ws)
} }
if ((c = lexer_putback_pop(state)) != '\0') { if ((c = lexer_putback_pop(state)) != '\0') {
if (lexer_is_ws(c) && !skip_ws) { if (!skip_ws) {
return c;
}
if (skip_ws && !lexer_is_ws(c)) {
return c; return c;
} }
} }
while ((c = readbuf_read(&state->rb, state->in_fd)) != '\0') { while ((c = readbuf_read(&state->rb, state->in_fd)) != '\0') {
if (lexer_is_ws(c)) { if (lexer_is_ws(c) && skip_ws) {
continue; continue;
} }