Repository navigation
[KUU-4825] Move template expression brace depth scan to Lean - #16392
Queued
devin-ai-integration[bot] wants to merge 1 commit into
Queued
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
KUU-4825 Co-Authored-By: sushi@mercari.com <fumiya.kume@hotmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
added this pull request to the merge queue
Dec 3, 2026
Any commits made after this event will not be merged.
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
KUU-4825: 文字列テンプレート式の中括弧深さスキャン(
scanTemplateExpression)を Lean に移行しました。ParserProofs/TemplateScan.lean: テンプレート本体をバイトレベルで走査する状態機械。空白・行コメント・ネストしたブロックコメント・バッククォート識別子を内部でスキップしつつ{/}の深さを追跡。引用符("/"""/')とネストしたテンプレート開始(${)は pause イベント — スキャンはそこで停止し、Swift が再帰スキャンを実行してから再開するため、モデルは文字列内部の規則を一切必要としない}は閉じ括弧とみなされない、外側閉じ括弧での停止位置、EOF での未終端停止位置、ネストしたブロックコメントの深さ追跡、pause 後の深さの引き継ぎconsumeTrivia+scanNextTokensで処理し、brace イベントは brace トークン、pause イベントはscanString/scanRawString/scanCharLiteral/テンプレート再帰に委譲。失敗時は offset 未変更のまま元のループにフォールバックskipTemplateExpression)は深さカウンタのガードが Swift 側に残る構造上そのまま維持(ネスト深度のカウント自体は再帰をまたぐホスト側の状態のため)動作確認
lake build ParserProofs.TemplateScan ParserProofs.Tests.TemplateScan ParserProofs.Runtime.TemplateScanFFI— 全証明通過bash Scripts/swift_test.sh --filter 'TemplateScanLeanTests'— 11/11 件パス(単純テンプレート・文字列/文字リテラル/コメント/バッククォート内の閉じ括弧の非終了・ネストテンプレート・brace トークン・未終端診断・raw文字列)回していない範囲
Link to Devin session: https://app.devin.ai/sessions/c88a4cfee40b4aaa8902b365f6e93500
Open in Devin Desktop: https://app.devin.ai/desktop/session/c88a4cfee40b4aaa8902b365f6e93500?variant=devin
Requested by: @fumiya-kume