Correctly parse \A (and others) inside %r{...} inside macros #6282
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.
Hopefully fixes #6180 (let's see what CI says)
The first commit fixes the direct issue:
%r(...)
is being confused inside macros with a macro var%r
... choosing%
as the start of a macro var was an unfortunate decision...The second commit fixes a few other things:
|
was missing as a delimiter in a few places (it might be worth to extract the list of delimiters into a constant, but it's a bit hard to use insidecase
when other chars are involved in subsequent conditions, so if someone wants to improve the code later, please go ahead, but in a separate PR please)next_char
after, for example,%r
: only onenext_char
skipped the%
but anotherr
was missing. This wasn't a big deal, but one spec in this PR would fail otherwise (so it was incorrect behaviour after all, just very hidden).