diff options
author | Ned Deily <nad@acm.org> | 2011-12-07 01:12:50 -0800 |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2011-12-07 01:12:50 -0800 |
commit | 69cd9efd6ea3aae49a583dbe36684fa1ed61b50a (patch) | |
tree | 428139ed7ffb523519431e12970c1d7c5abdd3ac /Lib | |
parent | 26acc5cde5c5d62062785343aa2a3f130c4bdc14 (diff) | |
parent | 6e1f75e3fc45bc8e1c78bf48ec36d45a666f9bb6 (diff) | |
download | cpython-69cd9efd6ea3aae49a583dbe36684fa1ed61b50a.tar.gz |
Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..".
(Patch by Tal Einat)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/ColorDelegator.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index ab69b8ac56..29b4640967 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"]) |