mirror of
https://github.com/vim-python/python-syntax.git
synced 2025-12-08 21:54:48 +08:00
Highlight 'yield from' statement
The 'yield from' statement was introduced in Python 3.3. Reported by Elizabeth Myers.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
Revision 3.3.6 (2013-11-18):
|
||||||
|
|
||||||
|
- Highlight 'yield from' statement introduced in Python 3.3. Reported by
|
||||||
|
Elizabeth Myers.
|
||||||
|
|
||||||
Revision 3.3.5 (2013-08-31):
|
Revision 3.3.5 (2013-08-31):
|
||||||
|
|
||||||
- Highlight 'import', 'from' and 'as' as include statements.
|
- Highlight 'import', 'from' and 'as' as include statements.
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ List of the contributors in alphabetical order:
|
|||||||
- Andrea Riciputi
|
- Andrea Riciputi
|
||||||
- Anton Butanaev
|
- Anton Butanaev
|
||||||
- Caleb Adamantine
|
- Caleb Adamantine
|
||||||
|
- Elizabeth Myers
|
||||||
- Jeroen Ruigrok van der Werven
|
- Jeroen Ruigrok van der Werven
|
||||||
- John Eikenberry
|
- John Eikenberry
|
||||||
- Marc Weber
|
- Marc Weber
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
" Language: Python
|
" Language: Python
|
||||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||||
" URL: https://github.com/hdima/python-syntax
|
" URL: https://github.com/hdima/python-syntax
|
||||||
" Last Change: 2013-08-31
|
" Last Change: 2013-11-18
|
||||||
" Filenames: *.py
|
" Filenames: *.py
|
||||||
" Version: 3.3.5
|
" Version: 3.3.6
|
||||||
"
|
"
|
||||||
" Based on python.vim (from Vim 6.1 distribution)
|
" Based on python.vim (from Vim 6.1 distribution)
|
||||||
" by Neil Schemenauer <nas at python dot ca>
|
" by Neil Schemenauer <nas at python dot ca>
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
" Andrea Riciputi
|
" Andrea Riciputi
|
||||||
" Anton Butanaev
|
" Anton Butanaev
|
||||||
" Caleb Adamantine
|
" Caleb Adamantine
|
||||||
|
" Elizabeth Myers
|
||||||
" Jeroen Ruigrok van der Werven
|
" Jeroen Ruigrok van der Werven
|
||||||
" John Eikenberry
|
" John Eikenberry
|
||||||
" Marc Weber
|
" Marc Weber
|
||||||
@@ -148,15 +149,18 @@ 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 raise
|
||||||
syn keyword pythonStatement global assert
|
syn keyword pythonStatement global assert
|
||||||
syn keyword pythonStatement lambda yield
|
syn keyword pythonStatement lambda
|
||||||
syn keyword pythonStatement with
|
syn keyword pythonStatement with
|
||||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||||
syn keyword pythonRepeat for while
|
syn keyword pythonRepeat for while
|
||||||
syn keyword pythonConditional if elif else
|
syn keyword pythonConditional if elif else
|
||||||
syn keyword pythonImport import from
|
syn keyword pythonImport import
|
||||||
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 "\<yield\>" display
|
||||||
|
syn match pythonImport "\<from\>" display
|
||||||
|
|
||||||
if s:Python2Syntax()
|
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
|
||||||
@@ -165,6 +169,7 @@ if s:Python2Syntax()
|
|||||||
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
|
||||||
syn keyword pythonStatement as nonlocal None
|
syn keyword pythonStatement as nonlocal None
|
||||||
|
syn match pythonStatement "\<yield\s\+from\>" display
|
||||||
syn keyword pythonBoolean True False
|
syn keyword pythonBoolean True False
|
||||||
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||||
endif
|
endif
|
||||||
|
|||||||
3
test.py
3
test.py
@@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
with break continue del exec return pass print raise global assert lambda yield
|
with break continue del exec return pass print raise global assert lambda yield
|
||||||
for while if elif else import from as try except finally and in is not or
|
for while if elif else import from as try except finally and in is not or
|
||||||
|
|
||||||
|
yield from
|
||||||
|
|
||||||
def functionname
|
def functionname
|
||||||
class Classname
|
class Classname
|
||||||
def функция
|
def функция
|
||||||
|
|||||||
Reference in New Issue
Block a user