stage1 修复错误 提供类型检查

This commit is contained in:
zzy
2026-07-25 10:28:24 +08:00
parent da9dae734c
commit 02095524b1
10 changed files with 640 additions and 153 deletions

View File

@@ -77,6 +77,8 @@ typedef struct spl_comp {
/* Error state */
char error_msg[COMP_ERROR_MAX];
int has_error;
usize error_line;
usize error_col;
/* Scopes */
spl_scope_vec_t scopes;
@@ -91,6 +93,7 @@ typedef struct spl_comp {
/* Current function context */
int current_func_idx;
int current_ret_type_idx;
char parse_context[COMP_ERROR_MAX]; /* current parsing context for error messages */
/* Loop context for break/continue */
int in_loop;
@@ -124,6 +127,7 @@ void spl_comp_reset(spl_comp_t *ctx);
/* Error reporting */
void spl_comp_error(spl_comp_t *ctx, const char *fmt, ...);
void spl_comp_err_tok(spl_comp_t *ctx, spl_tok_t *tok, const char *fmt, ...);
/* ============================================================
* Parser functions (spl_parser.c)