stage1 重写进行代码设计并重构 提供diag替换老旧错误处理

This commit is contained in:
zzy committed 2026-09-16 15:21:59 +08:00
1 parent 7cbe2d2b9a
commit e4347cc3ea
14 files changed
+983 -526

No files matched your search

+3 -2
View File
@@ -4,6 +4,7 @@
#include "../stage0/include/utils.h"
#include "spl_attr.h"
#include "spl_dbg.h"
#include "spl_diag.h"
#include "spl_lexer.h"
#include "spl_mpa.h"
#include "spl_tok.h"
@@ -483,11 +484,12 @@ struct spl_ast_node {
typedef VEC(spl_ast_node_t) spl_ast_node_vec_t;
typedef VEC(char *) spl_ast_cstr_ref_vec_t;
typedef struct {
int parsed;
spl_tok_vec_t input;
spl_ast_node_vec_t node_buckets;
spl_ast_cstr_ref_vec_t str_buckets;
spl_ast_node_ref_t root;
spl_diag_t *diag;
} spl_ast_t;
void spl_ast_init(spl_ast_t *ast, const spl_tok_vec_t *tok_vec /*move*/);
@@ -497,7 +499,6 @@ spl_ast_node_t *spl_ast_node(spl_ast_t *ast, spl_ast_node_ref_t node);
const char *spl_ast_node_name(spl_ast_node_t *node);
void spl_ast_parse(spl_ast_t *ast);
void spl_ast_valid(spl_ast_t *ast);
void spl_ast_dump(spl_ast_t *ast, spl_ast_node_ref_t node);
#endif /* __SPL_AST_H__ */