stage1 完整ast 部分ir 定义

This commit is contained in:
zzy
2026-08-01 22:48:42 +08:00
parent b43042c88d
commit a4ec5656d2
5 changed files with 189 additions and 46 deletions

View File

@@ -1,6 +1,7 @@
/* spl_lexer.c — SPL lexical analyzer */
#include "spl_lexer.h"
#include "spl_tok.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
@@ -395,6 +396,7 @@ spl_tok_vec_t spl_lex(const char *source, const char *fname) {
/* Two-char operators */
TRY_OP2('=', '=', TOK_EQ, TOK_ASSIGN)
TRY_OP2('=', '>', TOK_FAT_ARROW, TOK_ASSIGN)
TRY_OP2('!', '=', TOK_NEQ, TOK_NOT)
TRY_OP2('<', '=', TOK_LE, TOK_LT)
TRY_OP2('>', '=', TOK_GE, TOK_GT)