diff options
| author | Chloe M. <chloe@mirocom.org> | 2026-05-23 08:08:48 -0400 |
|---|---|---|
| committer | Chloe M. <chloe@mirocom.org> | 2026-05-23 08:13:45 -0400 |
| commit | 50bd6324feb9c129067cb60586e8690fee1a81bf (patch) | |
| tree | 267630287c367756ad91594d6f11e637247120a9 /core/lexer.c | |
| parent | 9bc47590c3c2108902e87a1059ad867d57357068 (diff) | |
core: lexer: Fix up whitespace skipping
Signed-off-by: Chloe M. <chloe@mirocom.org>
Diffstat (limited to 'core/lexer.c')
| -rw-r--r-- | core/lexer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/lexer.c b/core/lexer.c index 1d1e900..617ba41 100644 --- a/core/lexer.c +++ b/core/lexer.c @@ -73,13 +73,17 @@ lexer_consume_single(struct cescal_state *state, bool skip_ws) } 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; } } while ((c = readbuf_read(&state->rb, state->in_fd)) != '\0') { - if (lexer_is_ws(c)) { + if (lexer_is_ws(c) && skip_ws) { continue; } |
