Repository navigation
fix(tools): resume Rust scanning after ordinary strings - #960
Merged
LunaStev merged 1 commit intoOct 19, 2026
Merged
Conversation
Restore the inactive string state when an ordinary or byte string closes. Add regression coverage for same-line code, later function boundaries, escaped quotes, mixed raw/byte literals, and spacing idempotence. Fixes wavefnd#934 Signed-off-by: hiyouwhatsapp <[email protected]>
LunaStev
approved these changes
Oct 19, 2026
LunaStev
left a comment
Member
There was a problem hiding this comment.
Confirmed the scanner state fix and focused regression coverage for ordinary, byte, raw, and mixed strings. CI passes.
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.
Fixes #934.
The scanner represents active ordinary strings with
Trueand inactive strings withNone. Closing an ordinary or byte string previously assignedFalse, which still satisfiedstate["string"] is not None. All following source was masked as string content, causing function-spacing detection to miss actual functions.This switches the closing state to
None, matching the existing raw-string close behavior.Regression coverage
Added Python tests verifying:
Verification
python3 -m unittest tools.test_format_rustsuite could not be run locally because GitHub file checkout is unavailable in this environment; CI should run it.