stage1 重构测试且成功00-05

This commit is contained in:
zzy
2026-07-05 21:45:43 +08:00
parent 51d8510b79
commit e2e0ebc21f
39 changed files with 1090 additions and 461 deletions

View File

@@ -159,6 +159,8 @@ typedef struct {
/* Const values */
MAP(const char *, spl_val_t) const_values;
int addr_of_mode; /* 1 = inside & operator, suppress loads */
} spl_comp_t;
/* Initialize/destroy compiler context */
@@ -187,10 +189,10 @@ void parse_type_decl(spl_comp_t *ctx);
/* Precedence levels for Pratt parser */
enum {
PREC_MIN = 0, PREC_LOGOR = 1, PREC_LOGAND = 2, PREC_OR = 3,
PREC_XOR = 4, PREC_AND = 5, PREC_CMPEQ = 6, PREC_CMP = 7,
PREC_SHIFT = 8, PREC_ADD = 9, PREC_MUL = 10, PREC_PREFIX = 11,
PREC_POSTFIX = 12
PREC_MIN = 0, PREC_ASSIGN = 1, PREC_LOGOR = 2, PREC_LOGAND = 3, PREC_OR = 4,
PREC_XOR = 5, PREC_AND = 6, PREC_CMPEQ = 7, PREC_CMP = 8,
PREC_SHIFT = 9, PREC_ADD = 10, PREC_MUL = 11, PREC_PREFIX = 12,
PREC_POSTFIX = 13
};
/* Result of expression codegen */