Repository navigation
fix: Swift の複数行キャストと nil 合体式を正しく解析する - #37
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
as? Stringの次の行に??を置く有効な Swift 式が構文エラーになり、後続の構造解析も崩れる問題を修正します。optional 型に隣接する??用の external token を追加し、空白や改行を挟める nil 合体演算子から分離しました。既存の二重 optional 型と scanner の復元状態は維持します。tree-sitter-swift0.7.3 を Cargo のローカルパッチとして取り込み、元の MIT ライセンス、crate のチェックサム、文法ソースの出典、固定した generator/ABI、再生成・パッチ撤去の手順を同梱します。通常のビルドで Node.js や文法生成は不要です。検証: 修正前の再現テスト失敗と修正後の成功を確認。Swift の上流 corpus 238 ケースについて、元の crate・元の文法の再生成・修正後の full AST がすべて一致しました。Swift 単体26件(新規9件・既存17件)、CLI6件(新規3件・既存3件)、vendor単体2件でキャスト・nil 合体式、通常/二重 optional、ソース範囲、構文エラーからの復帰、既存の構造解析を確認し、fmt/clippy/impact と公開内容の検査も通過しています。
既知の制限:
value as? String/**/?? "fallback"は元の crate・再生成・修正後で同じ既存の AST 誤解析が残ります。この隣接コメントの別パターンは今回の改行による構文エラー修正の範囲外として記録しています。Closes #32