Skip to content

Fix inline reference renumbering - #796

Merged
ydah merged 1 commit into
masterfrom
fix/inline-reference-renumbering
Sep 4, 2026
Merged

ydah merged 1 commit into
masterfrom
fix/inline-reference-renumbering

Conversation

@ydah

@ydah ydah commented Sep 4, 2026

Copy link
Copy Markdown
Member

Inline::Resolver#replace_user_code renumbered positional references with repeated global substitutions. A reference shifted by one substitution could be shifted again, $1 could match the prefix of $10, location references could be renumbered incorrectly, and backslashes in an inline action could be interpreted as replacement backreferences.

Replace each parsed reference exactly once, in reverse source order using its column range, following the same position-based strategy as Grammar::Code#translated_code.

Add regression coverage for multiple $n and @n references, multi-digit references, and backslashes in inline actions.

@ydah
ydah force-pushed the fix/inline-reference-renumbering branch from 6daf08d to 08ab4a3 Compare September 4, 2026 12:18
@ydah
ydah force-pushed the fix/inline-reference-renumbering branch from 08ab4a3 to 697082c Compare September 4, 2026 12:55
@ydah
ydah merged commit c66c54a into master Sep 4, 2026
45 checks passed
@ydah
ydah deleted the fix/inline-reference-renumbering branch September 4, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant