stage1 人工重构ast.c

This commit is contained in:
zzy
2026-08-12 10:29:38 +08:00
parent 314100afbc
commit b0e6b406ac
22 changed files with 1619 additions and 2895 deletions

17
stage1/spl_dbg.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef __SPL_DBG_H__
#define __SPL_DBG_H__
#include "spl_tok.h"
typedef struct {
const char *dbg_name;
const char *fpath;
int line;
int col;
} spl_dbg_node_t;
#define SPL_FATAL(tok, fmt, ...) \
LOG_FATAL("fatal at %s:%zd:%zd " fmt, ((tok) && (tok)->fname ? (tok)->fname : "<null>"), \
((tok) ? (tok)->line : 0), ((tok) ? (tok)->col : 0), ##__VA_ARGS__)
#endif /* __SPL_DBG_H__ */