Skip to content

Commit bf94458

Browse files
Fix: Add 't' prefix to stringprefix regex to support Python 3.14 template strings
1 parent a15aeec commit bf94458

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/idlelib/colorizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def make_pat():
4747
name not in keyword.kwlist]
4848
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
4949
comment = any("COMMENT", [r"#[^\n]*"])
50-
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
50+
# Added 't' prefix and other combinations to support Python 3.14 template strings (PEP 701)
51+
stringprefix = r"(?i:r|u|f|t|fr|rf|b|br|rb|rt|tr)?"
5152
sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
5253
dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
5354
sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"

0 commit comments

Comments
 (0)