mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
Issue #14958: backport to 2.7.x from 3.3 (patch by Roger Serwy)
This commit is contained in:
parent
cef2006eaf
commit
10e93a6d40
2 changed files with 8 additions and 4 deletions
|
@ -20,10 +20,11 @@ def make_pat():
|
||||||
# 1st 'file' colorized normal, 2nd as builtin, 3rd as string
|
# 1st 'file' colorized normal, 2nd as builtin, 3rd as string
|
||||||
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
|
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
|
||||||
comment = any("COMMENT", [r"#[^\n]*"])
|
comment = any("COMMENT", [r"#[^\n]*"])
|
||||||
sqstring = r"(\b[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
|
stringprefix = r"(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR)?"
|
||||||
dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
|
sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?"
|
||||||
sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
|
dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?'
|
||||||
dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
|
sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
|
||||||
|
dq3string = stringprefix + r'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
|
||||||
string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
|
string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
|
||||||
return kw + "|" + builtin + "|" + comment + "|" + string +\
|
return kw + "|" + builtin + "|" + comment + "|" + string +\
|
||||||
"|" + any("SYNC", [r"\n"])
|
"|" + any("SYNC", [r"\n"])
|
||||||
|
|
|
@ -430,6 +430,9 @@ Library
|
||||||
- Issue #12157: Make pool.map() empty iterables correctly. Initial
|
- Issue #12157: Make pool.map() empty iterables correctly. Initial
|
||||||
patch by mouad.
|
patch by mouad.
|
||||||
|
|
||||||
|
- Issue #14958: Change IDLE systax highlighting to recognize all string and byte
|
||||||
|
literals currently supported in Python 2.7.
|
||||||
|
|
||||||
- Issue #14962: Update text coloring in IDLE shell window after changing
|
- Issue #14962: Update text coloring in IDLE shell window after changing
|
||||||
options. Patch by Roger Serwy.
|
options. Patch by Roger Serwy.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue