simplified rules for yield, yield from, from * import

This commit is contained in:
Michael Doronin
2016-12-08 12:55:36 +03:00
parent 8db44e7a57
commit 41efca646e

View File

@@ -154,7 +154,7 @@ 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 syn keyword pythonStatement pass yield
syn keyword pythonStatement raise nextgroup=pythonIdentifier skipwhite 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
@@ -171,7 +171,7 @@ syn keyword pythonInclude import
syn keyword pythonImport import syn keyword pythonImport import
syn match pythonIdentifier "\v[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters syn match pythonIdentifier "\v[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters
syn match pythonRaiseFromStatement "from\>" 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 pythonImport "^\s*\zsfrom\>"
@@ -183,7 +183,6 @@ if s:Python2Syntax()
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained
else else
syn keyword pythonStatement as nonlocal syn keyword pythonStatement as nonlocal
syn match pythonStatement "\v\s*<yield\s+from>"
syn match pythonStatement "\v(\.)@<!<await>" syn match pythonStatement "\v(\.)@<!<await>"
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained
syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite