diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-01-01 03:40:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-01-01 03:40:42 (GMT) |
commit | 1f7df8f2070391f28391e3594580c07e11b6b32b (patch) | |
tree | ec03dfe4f71df3840232731145b8f6736fc6a314 /Lib/idlelib/ColorDelegator.py | |
parent | b25d611f8d9140e83acbfffb6b0579939c88c033 (diff) | |
parent | 10e93a6d40502e100c68090730e0b3190df97854 (diff) | |
download | cpython-1f7df8f2070391f28391e3594580c07e11b6b32b.zip cpython-1f7df8f2070391f28391e3594580c07e11b6b32b.tar.gz cpython-1f7df8f2070391f28391e3594580c07e11b6b32b.tar.bz2 |
merge heads
Diffstat (limited to 'Lib/idlelib/ColorDelegator.py')
-rw-r--r-- | Lib/idlelib/ColorDelegator.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index 7f4d740..0610c4b 100644 --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -20,10 +20,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[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" - dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' - sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" - dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' + stringprefix = r"(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR)?" + 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"]) |