Bump the parser submodule: StringLiteral source spans - #76
Merged
Conversation
Picks up openscad_cpp_parser#3. A StringLiteral's position spanned only
its closing quote, and so did any node wrapping one -- a
PositionalArgument, a vector element -- because a string is matched by
several lexer rules and YY_USER_ACTION resets tokenStart on each.
parse_ast() consumers slicing source by those offsets could land inside
string CONTENT. BelfrySCAD's reformatter rewrote a comma inside
"h,l,height,length" in BOSL2's isosurface.scad, silently changing the
string's value; it needed a guard skipping any argument list with an
unbalanced quote span, which this makes unnecessary.
a = "txt"; span was '"' now '"txt"'
f("x,y", b); argument span '"' now '"x,y"'
1399/1399 tests pass. Verified through the Python API too, and against
BelfrySCAD: its separator-spacing pass now covers 74 of 97 corpus files
(up from 73, the extras being the ones its quote guard had to skip)
with no structural changes.
Minor bump: node positions change, which anything using them will see.
The push that opened #76 landed while GitHub Actions was still recovering from an outage and fired no workflow run at all.
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.
Picks up openscad_cpp_parser#3.
A
StringLiteral's position spanned only its closing quote, and so did any node wrapping one — aPositionalArgument, a vector element — because a string is matched by several lexer rules andYY_USER_ACTIONresetstokenStarton each of them.Why it mattered
parse_ast()consumers slicing source by those offsets could land inside string content. BelfrySCAD's reformatter rewrote a comma inside"h,l,height,length"in BOSL2'sisosurface.scad, silently changing the string's value. It needed a guard skipping any argument list with an unbalanced quote span — this bump makes that guard unnecessary.Verification
parse_astAPI, including escapes, empty strings and multi-line stringsMinor bump (0.17.0 → 0.18.0): node positions change, which anything using them will see.
🤖 Generated with Claude Code