Add register parameter to AM stack operations

This commit is contained in:
2025-08-10 20:38:04 +01:00
parent 57c39fd00b
commit 76efcef953
5 changed files with 29 additions and 19 deletions

View File

@@ -67,7 +67,7 @@ parse_state_t parse_proc(parse_ctx_t *ctx, const token_t *token)
append(ctx, expr_symbol(ctx->am, &token->symbol));
break;
case TOKEN_TYPE_OPEN_PAREN:
am_push(ctx->am);
am_push(ctx->am, EXPR);
push_state(ctx, PARSE_STATE_LIST);
AM_EXPR(ctx->am) = expr_empty_list(ctx->am);
ctx->state = PARSE_STATE_LIST;
@@ -76,7 +76,7 @@ parse_state_t parse_proc(parse_ctx_t *ctx, const token_t *token)
ctx->state = pop_state(ctx);
if (ctx->state == PARSE_STATE_LIST) {
expr_t *expr = AM_EXPR(ctx->am);
am_pop(ctx->am);
am_pop(ctx->am, EXPR);
append(ctx, expr);
}
break;