stage1 修复错误 提供类型检查
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user