stage1 完成11-13测试

This commit is contained in:
zzy
2026-07-06 13:00:55 +08:00
parent 0182b8ed5c
commit ad473f245c
6 changed files with 363 additions and 69 deletions

View File

@@ -4,14 +4,7 @@
#include <stdlib.h>
#include <string.h>
static spl_tok_t *peek(spl_comp_t *ctx) { return &vec_at(ctx->toks, ctx->tok_idx); }
static spl_tok_t *advance(spl_comp_t *ctx) {
spl_tok_t *t = &vec_at(ctx->toks, ctx->tok_idx);
if (t->type != TOK_EOF)
ctx->tok_idx++;
return t;
}
/* Token helpers — using shared peek/advance from spl_parser.c */
static int expect(spl_comp_t *ctx, spl_tok_type_t type) {
if (peek(ctx)->type == type) {