Skip to content

fix(jsonc): 修复尾随逗号后有注释时的解析错误(A02) - #7

Closed
ChenM0M wants to merge 1 commit into
mainfrom
codex/agent-config-a02-trailing-comments
Closed

ChenM0M wants to merge 1 commit into
mainfrom
codex/agent-config-a02-trailing-comments

Conversation

@ChenM0M

@ChenM0M ChenM0M commented Sep 22, 2026

Copy link
Copy Markdown
Owner

合法 JSONC 在尾随逗号后插入行注释或块注释时,原单次扫描只能跳过空白,留下逗号而导致解析失败。

先移除注释,再在字符串之外识别尾随逗号;用空格替换逗号以保留错误列号。同时确保空对象/数组中的孤立逗号、重复逗号和未闭合注释仍被拒绝。

验证:存储层 12 项测试、OpenCode adapter 13 项测试通过;新增 10 个输入样例覆盖对象、数组、嵌套、多注释、CRLF、字符串内相似字符及非法输入。rustfmt 和 git diff --check 通过。

范围:清单 A02,独立基于 main,与 #6 的 OpenCode .json 解析格式修复分开。Windows 原生端到端尚未验证。

用户已批准本批 PR 使用 GitHub 连接器默认提交身份;上传 tree 与已验证本地提交一致。

@ChenM0M

ChenM0M commented Sep 23, 2026

Copy link
Copy Markdown
Owner Author

内容已随整合 PR #33 合入 main (e3cb573)。此 PR 为被取代的分支/栈式 PR,按用户指示关闭;分支保留,未删除。

@ChenM0M ChenM0M closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant