Skip to content

Commit c85d026

Browse files
committed
Update statements and functions
1 parent 26f2a6b commit c85d026

File tree

2 files changed

+55
-20
lines changed

2 files changed

+55
-20
lines changed

syntax/python.vim

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,8 @@ endif
6060
" Keywords
6161
"
6262

63-
syn keyword pythonStatement break continue del
64-
syn keyword pythonStatement exec return
65-
syn keyword pythonStatement pass yield
63+
syn keyword pythonStatement break continue del return pass yield global assert lambda with
6664
syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite
67-
syn keyword pythonStatement global assert
68-
syn keyword pythonStatement lambda
69-
syn keyword pythonStatement with
7065
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
7166
if s:Enabled('g:python_highlight_class_vars')
7267
syn keyword pythonClassVar self cls
@@ -86,6 +81,7 @@ if s:Python2Syntax()
8681
if !s:Enabled('g:python_print_as_function')
8782
syn keyword pythonStatement print
8883
endif
84+
syn keyword pythonStatement exec
8985
syn keyword pythonImport as
9086
syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained
9187
else
@@ -345,15 +341,15 @@ endif
345341
"
346342

347343
if s:Enabled('g:python_highlight_builtin_funcs')
348-
let s:funcs_re = '__import__|abs|all|any|bin|chr|classmethod|cmp|compile|complex|delattr|dir|divmod|enumerate|eval|filter|format|getattr|globals|hasattr|hash|hex|id|input|isinstance|issubclass|iter|len|locals|map|max|min|next|oct|open|ord|pow|property|range|repr|reversed|round|setattr|slice|sorted|staticmethod|sum|super|type|vars|zip'
344+
let s:funcs_re = '__import__|abs|all|any|bin|callable|chr|classmethod|cmp|compile|complex|delattr|dir|divmod|enumerate|eval|filter|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|map|max|min|memoryview|next|oct|open|ord|pow|property|range|repr|reversed|round|setattr|slice|sorted|staticmethod|sum|super|type|vars|zip'
349345

350346
if s:Python2Syntax()
351-
let s:funcs_re .= '|apply|basestring|buffer|callable|coerce|execfile|file|help|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'
347+
let s:funcs_re .= '|apply|basestring|buffer|coerce|execfile|file|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'
352348
if s:Enabled('g:python_print_as_function')
353349
let s:funcs_re .= '|print'
354350
endif
355351
else
356-
let s:funcs_re .= '|ascii|exec|memoryview|print'
352+
let s:funcs_re .= '|ascii|exec|print'
357353
endif
358354

359355
execute 'syn match pythonBuiltinFunc ''\v\.@<!\zs<%(' . s:funcs_re . ')>'''

tests/test.py

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Keywords.
1010

11-
with break continue del exec return pass print raise global assert lambda yield
11+
with break continue del return pass raise global assert lambda yield
1212
for while if elif else import as try except finally
1313

1414
from test import var as name
@@ -22,6 +22,13 @@ class Classname
2222
def функция
2323
class Класс
2424

25+
# Keywords: Python 2
26+
27+
exec
28+
print
29+
30+
# Keywords: Python 3
31+
2532
await
2633
async def Test
2734
async with
@@ -33,16 +40,48 @@ async def Test
3340

3441
# Bultin types
3542

36-
bool float frozenset dict int list object str tuple set
37-
38-
# Builtin functions
39-
40-
__import__ abs all any apply basestring buffer callable chr classmethod
41-
cmp coerce compile complex delattr dir divmod enumerate eval execfile file
42-
filter getattr globals hasattr hash help hex id input intern isinstance
43-
issubclass iter len locals long map max min oct open ord pow print property
44-
range raw_input reduce reload repr reversed round setattr slice sorted
45-
staticmethod sum super type unichr unicode vars xrange zip
43+
bool bytearray dict float frozenset int list object set str tuple
44+
45+
# Builtin functions: Python 2
46+
47+
abs() divmod() input() open() staticmethod()
48+
all() enumerate() int() ord() str()
49+
any() eval() isinstance() pow() sum()
50+
basestring() execfile() issubclass() print() super()
51+
bin() file() iter() property() tuple()
52+
bool() filter() len() range() type()
53+
bytearray() float() list() raw_input() unichr()
54+
callable() format() locals() reduce() unicode()
55+
chr() frozenset() long() reload() vars()
56+
classmethod() getattr() map() repr() xrange()
57+
cmp() globals() max() reversed() zip()
58+
compile() hasattr() memoryview() round() __import__()
59+
complex() hash() min() set()
60+
delattr() help() next() setattr()
61+
dict() hex() object() slice()
62+
dir() id() oct() sorted()
63+
64+
apply()
65+
buffer()
66+
coerce()
67+
intern()
68+
69+
# Builtin functions: Python 3
70+
71+
abs() dict() help() min() setattr()
72+
all() dir() hex() next() slice()
73+
any() divmod() id() object() sorted()
74+
ascii() enumerate() input() oct() staticmethod()
75+
bin() eval() int() open() str()
76+
bool() exec() isinstance() ord() sum()
77+
bytearray() filter() issubclass() pow() super()
78+
bytes() float() iter() print() tuple()
79+
callable() format() len() property() type()
80+
chr() frozenset() list() range() vars()
81+
classmethod() getattr() locals() repr() zip()
82+
compile() globals() map() reversed() __import__()
83+
complex() hasattr() max() round()
84+
delattr() hash() memoryview() set()
4685

4786
# Builtin exceptions and warnings.
4887

0 commit comments

Comments
 (0)