[0044] 修复 gf fix 将独立 | 标识符误识别为 bar symbol 定界符#793
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gf fix的 tokenizer 将独立|标识符无条件当作 bar symbol(如|symbol with spaces|)开始定界符的问题|作为普通标识符时(如define-regexp-grammar语法中的选择符),从第一个|到下一个|之间的所有内容(包括大量括号)被当作一个 token 跳过,造成括号修复结果完全错误Changes
tools/fix/liii/goldfix-tokenize.scm: 在tokenize函数的\|处理分支增加not (whitespace-char? next-c)判断,只有当\|后面紧跟非空白字符时才进入 bar symbol 处理逻辑tools/fix/tests/liii/goldfix-tokenize/tokenize-lines-test.scm: 添加独立|的 tokenize 测试tools/fix/tests/liii/goldfix-repair/fix-string-test.scm: 添加包含独立|的define-regexp-grammar片段修复测试Test plan
|被正确识别为普通标识符)bin/gf fix --dry-run对menu-widget.scm的输出与原始文件一致🤖 Generated with Claude Code