diff options
| author | Chloe M. <chloe@mirocom.org> | 2026-05-25 00:11:51 -0500 |
|---|---|---|
| committer | Chloe M. <chloe@mirocom.org> | 2026-05-25 00:12:15 -0500 |
| commit | 3d74850a2fcb755350d3f6efe4195704e872a294 (patch) | |
| tree | 68237e5113440c2cc540775ec6ad571b038b4f74 | |
| parent | 85c21a81bb07b8871e66fa80d377b330ab5104f1 (diff) | |
parser: Use 'res' instead of 'tok' indirection
Signed-off-by: Chloe M. <chloe@mirocom.org>
| -rw-r--r-- | core/parser.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/parser.c b/core/parser.c index b4f5696..a438b74 100644 --- a/core/parser.c +++ b/core/parser.c @@ -90,8 +90,6 @@ preprocessor_push(struct tokbuf *tokbuf, struct token *tok) static int parser_nom(struct cescal_state *state, struct token *res) { - struct token tok; - if (state == NULL || res == NULL) { errno = EINVAL; return -1; @@ -99,17 +97,17 @@ parser_nom(struct cescal_state *state, struct token *res) switch (state->pass) { case 0: /* Pre-processor */ - if (lexer_nom(state, &tok) < 0) { + if (lexer_nom(state, res) < 0) { return -1; } - if (preprocessor_push(&state->tokbuf, &tok) < 0) { + if (preprocessor_push(state, &state->tokbuf, res) < 0) { return -1; } break; case 1: /* Parse */ - if (tokbuf_pop(&state->tokbuf, &tok) < 0) { + if (tokbuf_pop(&state->tokbuf, res) < 0) { return -1; } |
