summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-12-07 09:12:50 (GMT)
committerNed Deily <nad@acm.org>2011-12-07 09:12:50 (GMT)
commit3be637e67f9840d93dd3379aa04015ed6502427e (patch)
tree18ca16d0a840594149a1dffec1c20e2211f980f7 /Lib/idlelib
parent4ce6aa4ba7b5cf4ab48319e873d5afdb4660c76d (diff)
parent2f0ad742b5c13d79aa4e3c2e935cfbe04f1e9a08 (diff)
downloadcpython-3be637e67f9840d93dd3379aa04015ed6502427e.zip
cpython-3be637e67f9840d93dd3379aa04015ed6502427e.tar.gz
cpython-3be637e67f9840d93dd3379aa04015ed6502427e.tar.bz2
Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
(Patch by Tal Einat)
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/ColorDelegator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
index ab69b8a..29b4640 100644
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -20,10 +20,10 @@ 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[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
- dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
- sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
- dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
+ sqstring = r"(\b[rRbB])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
+ dqstring = r'(\b[rRbB])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
+ sq3string = r"(\b[rRbB])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
+ dq3string = r'(\b[rRbB])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
return kw + "|" + builtin + "|" + comment + "|" + string +\
"|" + any("SYNC", [r"\n"])