summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2012-05-30 05:55:43 (GMT)
committerNed Deily <nad@acm.org>2012-05-30 05:55:43 (GMT)
commit5e92a1ef5a906cd34f122cf0ee54e0303ae07a5f (patch)
tree8eea29fae8b881dc811c996425ae74d7c3f0bc4b
parente8eb9127225caffb3693c7d8342d6c1b8579939c (diff)
downloadcpython-5e92a1ef5a906cd34f122cf0ee54e0303ae07a5f.zip
cpython-5e92a1ef5a906cd34f122cf0ee54e0303ae07a5f.tar.gz
cpython-5e92a1ef5a906cd34f122cf0ee54e0303ae07a5f.tar.bz2
Issue #14958: Change IDLE systax highlighting to recognize all string and
byte literals supported in Python 3.3.
-rw-r--r--Lib/idlelib/ColorDelegator.py9
-rw-r--r--Misc/NEWS3
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
index 339ac5e..e4ccb42 100644
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -21,10 +21,11 @@ def make_pat():
# 1st 'file' colorized normal, 2nd as builtin, 3rd as string
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
comment = any("COMMENT", [r"#[^\n]*"])
- sqstring = r"(\b[rRbB])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
- dqstring = r'(\b[rRbB])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
- sq3string = r"(\b[rRbB])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
- dq3string = r'(\b[rRbB])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
+ stringprefix = r"(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR|rb|rB|Rb|RB)?"
+ sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
+ dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
+ sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
+ dq3string = stringprefix + r'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
return kw + "|" + builtin + "|" + comment + "|" + string +\
"|" + any("SYNC", [r"\n"])
diff --git a/Misc/NEWS b/Misc/NEWS
index 73e9dc5..6341af5 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@ Core and Builtins
Library
-------
+- Issue #14958: Change IDLE systax highlighting to recognize all string and
+ byte literals supported in Python 3.3.
+
- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
- Issue #14443: Tell rpmbuild to use the correct version of Python in