mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756) (#139831)
gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756)
Add 't' prefix to colorizer.py stringprefix regex to support Python 3.14 template strings.
Add t prefixes to test_colorizer.py source test text and adjust line numbers on test methods.
---------
(cherry picked from commit 6fd1418341)
Co-authored-by: Anuradha Agrawal <paysur2111@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
08faef865c
commit
342b644bd2
3 changed files with 17 additions and 15 deletions
|
|
@ -47,7 +47,7 @@ def make_pat():
|
|||
name not in keyword.kwlist]
|
||||
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
|
||||
comment = any("COMMENT", [r"#[^\n]*"])
|
||||
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb)?"
|
||||
stringprefix = r"(?i:r|u|f|fr|rf|b|br|rb|t|rt|tr)?"
|
||||
sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
|
||||
dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
|
||||
sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue