mirror of
https://github.com/vim-python/python-syntax.git
synced 2025-12-08 21:54:48 +08:00
now from from import in highlighted as import and as keyword in `raise
from`
This commit is contained in:
@@ -154,7 +154,8 @@ syn keyword pythonInstanceVariable self
|
|||||||
syn keyword pythonClassVaraible cls
|
syn keyword pythonClassVaraible cls
|
||||||
syn keyword pythonStatement break continue del
|
syn keyword pythonStatement break continue del
|
||||||
syn keyword pythonStatement exec return
|
syn keyword pythonStatement exec return
|
||||||
syn keyword pythonStatement pass raise
|
syn keyword pythonStatement pass
|
||||||
|
syn keyword pythonStatement raise nextgroup=pythonIdentifier skipwhite
|
||||||
syn keyword pythonStatement global assert
|
syn keyword pythonStatement global assert
|
||||||
syn keyword pythonStatement lambda
|
syn keyword pythonStatement lambda
|
||||||
syn keyword pythonStatement with
|
syn keyword pythonStatement with
|
||||||
@@ -163,14 +164,16 @@ syn keyword pythonRepeat for while
|
|||||||
syn keyword pythonConditional if elif else
|
syn keyword pythonConditional if elif else
|
||||||
" The standard pyrex.vim unconditionally removes the pythonInclude group, so
|
" The standard pyrex.vim unconditionally removes the pythonInclude group, so
|
||||||
" we provide a dummy group here to avoid crashing pyrex.vim.
|
" we provide a dummy group here to avoid crashing pyrex.vim.
|
||||||
syn keyword pythonInclude import
|
|
||||||
syn keyword pythonImport import
|
|
||||||
syn keyword pythonImport from
|
|
||||||
syn keyword pythonException try except finally
|
syn keyword pythonException try except finally
|
||||||
syn keyword pythonOperator and in is not or
|
syn keyword pythonOperator and in is not or
|
||||||
syn match pythonStatement "\s*\([.,]\)\@<!\<yield\>"
|
syn match pythonStatement "\s*\([.,]\)\@<!\<yield\>"
|
||||||
|
syn keyword pythonInclude import
|
||||||
|
syn keyword pythonImport import
|
||||||
|
syn match pythonIdentifier "\v[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters
|
||||||
|
syn match pythonRaiseFromStatement "from\>"
|
||||||
|
syn match pythonImport "\v^\s*\zsfrom\ze\s*[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*\s*import"
|
||||||
|
|
||||||
|
|
||||||
syn match pythonIdentifier "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters
|
|
||||||
|
|
||||||
if s:Python2Syntax()
|
if s:Python2Syntax()
|
||||||
if !s:Enabled("g:python_print_as_function")
|
if !s:Enabled("g:python_print_as_function")
|
||||||
@@ -213,8 +216,7 @@ syn region FunctionParameters start='(' end=')' display contains=
|
|||||||
\ pythonBytes,
|
\ pythonBytes,
|
||||||
\ pythonBuiltinObj,
|
\ pythonBuiltinObj,
|
||||||
\ pythonBuiltinFunc,
|
\ pythonBuiltinFunc,
|
||||||
\ pythonBoolean
|
\ pythonBoolean nextgroup=pythonRaiseFromStatement display contained
|
||||||
\ nextgroup=OptionalParameters display contained
|
|
||||||
syn match OptionalParameters /\i*\ze=/ display contained
|
syn match OptionalParameters /\i*\ze=/ display contained
|
||||||
"
|
"
|
||||||
" Decorators (new in Python 2.4)
|
" Decorators (new in Python 2.4)
|
||||||
@@ -526,6 +528,7 @@ if version >= 508 || !exists("did_python_syn_inits")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
HiLink pythonStatement Statement
|
HiLink pythonStatement Statement
|
||||||
|
HiLink pythonRaiseFromStatement Statement
|
||||||
HiLink pythonImport Include
|
HiLink pythonImport Include
|
||||||
HiLink pythonFunction Function
|
HiLink pythonFunction Function
|
||||||
HiLink pythonConditional Conditional
|
HiLink pythonConditional Conditional
|
||||||
|
|||||||
Reference in New Issue
Block a user