mirror of
https://github.com/vim-python/python-syntax.git
synced 2026-01-27 05:12:21 +08:00
Update statements and functions
This commit is contained in:
@@ -60,13 +60,8 @@ endif
|
|||||||
" Keywords
|
" Keywords
|
||||||
"
|
"
|
||||||
|
|
||||||
syn keyword pythonStatement break continue del
|
syn keyword pythonStatement break continue del return pass yield global assert lambda with
|
||||||
syn keyword pythonStatement exec return
|
|
||||||
syn keyword pythonStatement pass yield
|
|
||||||
syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite
|
syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite
|
||||||
syn keyword pythonStatement global assert
|
|
||||||
syn keyword pythonStatement lambda
|
|
||||||
syn keyword pythonStatement with
|
|
||||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||||
if s:Enabled('g:python_highlight_class_vars')
|
if s:Enabled('g:python_highlight_class_vars')
|
||||||
syn keyword pythonClassVar self cls
|
syn keyword pythonClassVar self cls
|
||||||
@@ -86,6 +81,7 @@ if s:Python2Syntax()
|
|||||||
if !s:Enabled('g:python_print_as_function')
|
if !s:Enabled('g:python_print_as_function')
|
||||||
syn keyword pythonStatement print
|
syn keyword pythonStatement print
|
||||||
endif
|
endif
|
||||||
|
syn keyword pythonStatement exec
|
||||||
syn keyword pythonImport as
|
syn keyword pythonImport as
|
||||||
syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained
|
syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained
|
||||||
else
|
else
|
||||||
@@ -345,15 +341,15 @@ endif
|
|||||||
"
|
"
|
||||||
|
|
||||||
if s:Enabled('g:python_highlight_builtin_funcs')
|
if s:Enabled('g:python_highlight_builtin_funcs')
|
||||||
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'
|
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'
|
||||||
|
|
||||||
if s:Python2Syntax()
|
if s:Python2Syntax()
|
||||||
let s:funcs_re .= '|apply|basestring|buffer|callable|coerce|execfile|file|help|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'
|
let s:funcs_re .= '|apply|basestring|buffer|coerce|execfile|file|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'
|
||||||
if s:Enabled('g:python_print_as_function')
|
if s:Enabled('g:python_print_as_function')
|
||||||
let s:funcs_re .= '|print'
|
let s:funcs_re .= '|print'
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let s:funcs_re .= '|ascii|exec|memoryview|print'
|
let s:funcs_re .= '|ascii|exec|print'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
execute 'syn match pythonBuiltinFunc ''\v\.@<!\zs<%(' . s:funcs_re . ')>'''
|
execute 'syn match pythonBuiltinFunc ''\v\.@<!\zs<%(' . s:funcs_re . ')>'''
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# Keywords.
|
# Keywords.
|
||||||
|
|
||||||
with break continue del exec return pass print raise global assert lambda yield
|
with break continue del return pass raise global assert lambda yield
|
||||||
for while if elif else import as try except finally
|
for while if elif else import as try except finally
|
||||||
|
|
||||||
from test import var as name
|
from test import var as name
|
||||||
@@ -22,6 +22,13 @@ class Classname
|
|||||||
def функция
|
def функция
|
||||||
class Класс
|
class Класс
|
||||||
|
|
||||||
|
# Keywords: Python 2
|
||||||
|
|
||||||
|
exec
|
||||||
|
print
|
||||||
|
|
||||||
|
# Keywords: Python 3
|
||||||
|
|
||||||
await
|
await
|
||||||
async def Test
|
async def Test
|
||||||
async with
|
async with
|
||||||
@@ -33,16 +40,48 @@ True False Ellipsis None NotImplemented
|
|||||||
|
|
||||||
# Bultin types
|
# Bultin types
|
||||||
|
|
||||||
bool float frozenset dict int list object str tuple set
|
bool bytearray dict float frozenset int list object set str tuple
|
||||||
|
|
||||||
# Builtin functions
|
# Builtin functions: Python 2
|
||||||
|
|
||||||
__import__ abs all any apply basestring buffer callable chr classmethod
|
abs() divmod() input() open() staticmethod()
|
||||||
cmp coerce compile complex delattr dir divmod enumerate eval execfile file
|
all() enumerate() int() ord() str()
|
||||||
filter getattr globals hasattr hash help hex id input intern isinstance
|
any() eval() isinstance() pow() sum()
|
||||||
issubclass iter len locals long map max min oct open ord pow print property
|
basestring() execfile() issubclass() print() super()
|
||||||
range raw_input reduce reload repr reversed round setattr slice sorted
|
bin() file() iter() property() tuple()
|
||||||
staticmethod sum super type unichr unicode vars xrange zip
|
bool() filter() len() range() type()
|
||||||
|
bytearray() float() list() raw_input() unichr()
|
||||||
|
callable() format() locals() reduce() unicode()
|
||||||
|
chr() frozenset() long() reload() vars()
|
||||||
|
classmethod() getattr() map() repr() xrange()
|
||||||
|
cmp() globals() max() reversed() zip()
|
||||||
|
compile() hasattr() memoryview() round() __import__()
|
||||||
|
complex() hash() min() set()
|
||||||
|
delattr() help() next() setattr()
|
||||||
|
dict() hex() object() slice()
|
||||||
|
dir() id() oct() sorted()
|
||||||
|
|
||||||
|
apply()
|
||||||
|
buffer()
|
||||||
|
coerce()
|
||||||
|
intern()
|
||||||
|
|
||||||
|
# Builtin functions: Python 3
|
||||||
|
|
||||||
|
abs() dict() help() min() setattr()
|
||||||
|
all() dir() hex() next() slice()
|
||||||
|
any() divmod() id() object() sorted()
|
||||||
|
ascii() enumerate() input() oct() staticmethod()
|
||||||
|
bin() eval() int() open() str()
|
||||||
|
bool() exec() isinstance() ord() sum()
|
||||||
|
bytearray() filter() issubclass() pow() super()
|
||||||
|
bytes() float() iter() print() tuple()
|
||||||
|
callable() format() len() property() type()
|
||||||
|
chr() frozenset() list() range() vars()
|
||||||
|
classmethod() getattr() locals() repr() zip()
|
||||||
|
compile() globals() map() reversed() __import__()
|
||||||
|
complex() hasattr() max() round()
|
||||||
|
delattr() hash() memoryview() set()
|
||||||
|
|
||||||
# Builtin exceptions and warnings.
|
# Builtin exceptions and warnings.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user