stage2 修复大量AI生成的风格问题 stage1 修复对于vm abi的错误生成

This commit is contained in:
zzy committed 2026-10-03 15:05:55 +08:00
1 parent 0e38858785
commit 76f980654c
40 files changed
+619 -938

No files matched your search

+2 -7
View File
@@ -1,9 +1,7 @@
// Expect retcode = 0
// 词法分析器:字节流 -> Vec<Token>。镜像 stage1/spl_lexer.c 的行为:
// 行注释作为 token 产出;块注释(可嵌套)整体跳过;换行产出 Endline;EOF 产出 Eof。
// 复用 utils/ascii 做字符分类;整型/字符在词法期解码后放进 TokenKind 载荷。
// Token.text 借用输入字节,不复制。
// 字节流 -> Vec<Token>。行为镜像 splc0(保证 diff):行注释作为 token 产出,块注释
//(可嵌套)跳过,换行产 Endline,EOF 产 Eof。Token.text 借用输入,不复制。
type .{ .Vec, .VecResult } = @import("utils/vec.spl");
type .{ .ByteView } = @import("utils/byte_view.spl");
@@ -80,7 +78,6 @@ fn decode_char(text: ByteView): u8 {
ret e;
}
// ---- 读取辅助 ----
fn has2(self: *Lexer, ch: u8): bool {
ret self.pos + 1 < self.src.len && self.src.ptr[self.pos + 1] == ch;
@@ -120,7 +117,6 @@ fn op3(self: *Lexer, out: *Vec, punct: Punct, start: usize, line: usize, col: us
emit_to(self, out, .Punct(punct), start, start + 3, line, col);
}
// ---- 复合扫描 ----
fn scan_int(self: *Lexer, out: *Vec, start: usize, line: usize, col: usize) {
var p = self.pos;
@@ -453,7 +449,6 @@ fn lex(src: ByteView, diag: *Diag, file: usize): VecResult {
ret .Ok(out);
}
// ---- 测试辅助 ----
fn view(text: []u8): ByteView {
ret ByteView.from_slice(text);