stage2 修复大量AI生成的风格问题 stage1 修复对于vm abi的错误生成
This commit is contained in:
1 parent
0e38858785
commit
76f980654c
40 files changed
+619
-938
No files matched your search
@@ -1,10 +1,6 @@
|
||||
// Expect retcode = 0
|
||||
// 轻量 JSON 解析 / 输出器(递归下降 + 节点池),用于验证底层库的拼装,未来服务 LSP。
|
||||
// 设计:
|
||||
// - 输入 ByteView,字符串/数字以“源切片”借用,不做解码,round-trip 保真;
|
||||
// - 节点池 Vec[JsonNode];数组/对象子项存 Vec[JsonChild],保留插入顺序;
|
||||
// - 错误带字节位置(error.spl);输出写 ByteBuffer;缩进/数字用 ByteBuffer/fmt。
|
||||
// 限制:不做字符串转义解码、数字不做数值化(原样保存);递归/输出深度上限见 max_depth()。
|
||||
// 轻量 JSON 解析/输出器:输入按源切片借用、不解码(round-trip 保真),数字不做数值化。
|
||||
// 节点/子项存 Vec 保留插入顺序;输出写 ByteBuffer。递归/输出深度上限见 max_depth()。
|
||||
|
||||
type .{ .Error, .Status, .make, .at } = @import("error.spl");
|
||||
type .{ .ByteView, .ViewResult, .FindResult } = @import("byte_view.spl");
|
||||
@@ -393,7 +389,7 @@ fn root_index(doc: *Json): usize {
|
||||
ret doc.root;
|
||||
}
|
||||
|
||||
// 枚举 tag 取整(stage1 枚举 == 有缺陷,用 @enum2int 比较更稳妥)。
|
||||
// 枚举 tag 取整:枚举 == 不可靠,用 @enum2int 比较。
|
||||
fn kind_code(kind: JsonKind): usize {
|
||||
ret @enum2int(kind) as usize;
|
||||
}
|
||||
@@ -578,7 +574,6 @@ fn emit_pretty(out: *ByteBuffer, doc: *Json, indent: usize): Status {
|
||||
ret emit(out, doc, doc.root, indent, 0);
|
||||
}
|
||||
|
||||
// ---- 构造辅助(写 JSON 片段;字符串需由调用方保证已转义)----
|
||||
|
||||
fn write_int(out: *ByteBuffer, value: i64): Status {
|
||||
ret append_i64(out, value, 10, false);
|
||||
@@ -588,7 +583,6 @@ fn write_u64(out: *ByteBuffer, value: u64): Status {
|
||||
ret append_u64(out, value, 10, false);
|
||||
}
|
||||
|
||||
// ---- 测试辅助 ----
|
||||
|
||||
fn expect_ok(result: Status) {
|
||||
match result {
|
||||
|
||||
Reference in new issue
Block a user