Skip to content

Conversation

@bartbroere
Copy link
Contributor

Python 3.14 introduces template-strings. Like other types of strings (byte strings, f-strings, raw strings) it is denoted by the character before the quotes. In this case, the new prefix is a t.

Some combinations of these two are also allowed: raw f-strings (fr / rf) and raw t-strings (ft, tf) for example.
Some other combinations are not allowed however: a bytes and unicode string (bu) is the most obvious incompatible pair.

Right now, the regex matches all pairs of rtfbu as a valid pair, which includes invalid combinations.
I could address this in the regex in this pull request, but since the existing behaviour already matches some combinations that are invalid, I didn't want to needlessly complicate this regex to make the highlighter more "technically correct".

@tancnle
Copy link
Collaborator

tancnle commented Sep 25, 2025

Thanks, @bartbroere. LGTM 🚀

@tancnle tancnle added this pull request to the merge queue Sep 25, 2025
Merged via the queue into rouge-ruby:master with commit b30020b Sep 25, 2025
10 checks passed
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.

2 participants