mirror of
https://github.com/python/cpython.git
synced 2025-10-15 19:29:46 +00:00
#6528 None, True, False are keywords in 3.x. Patch by Roger Serwy.
This commit is contained in:
parent
01b34afb3a
commit
dc224f82c0
2 changed files with 3 additions and 2 deletions
|
@ -15,7 +15,8 @@ def any(name, alternates):
|
||||||
def make_pat():
|
def make_pat():
|
||||||
kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
|
kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
|
||||||
builtinlist = [str(name) for name in dir(builtins)
|
builtinlist = [str(name) for name in dir(builtins)
|
||||||
if not name.startswith('_')]
|
if not name.startswith('_') and \
|
||||||
|
name not in keyword.kwlist]
|
||||||
# self.file = open("file") :
|
# self.file = open("file") :
|
||||||
# 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"
|
||||||
|
|
|
@ -199,7 +199,7 @@ class ConfigDialog(Toplevel):
|
||||||
("'string'",'string'),('\n var1 = ','normal'),("'selected'",'hilite'),
|
("'string'",'string'),('\n var1 = ','normal'),("'selected'",'hilite'),
|
||||||
('\n var2 = ','normal'),("'found'",'hit'),
|
('\n var2 = ','normal'),("'found'",'hit'),
|
||||||
('\n var3 = ','normal'),('list', 'builtin'), ('(','normal'),
|
('\n var3 = ','normal'),('list', 'builtin'), ('(','normal'),
|
||||||
('None', 'builtin'),(')\n\n','normal'),
|
('None', 'keyword'),(')\n\n','normal'),
|
||||||
(' error ','error'),(' ','normal'),('cursor |','cursor'),
|
(' error ','error'),(' ','normal'),('cursor |','cursor'),
|
||||||
('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'),
|
('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'),
|
||||||
(' ','normal'),('stderr','stderr'),('\n','normal'))
|
(' ','normal'),('stderr','stderr'),('\n','normal'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue