Browse Source

Merge branch 'master' of https://github.com/strin/python-syntax

Tianlin Shi 8 years ago
parent
commit
20789980b1
4 changed files with 21 additions and 4 deletions
  1. 6
    0
      CHANGES.txt
  2. 2
    0
      README.rst
  3. 8
    4
      syntax/python.vim
  4. 5
    0
      test.py

+ 6
- 0
CHANGES.txt View File

1
+Revision 3.6.0 (2015-11-XX):
2
+
3
+    - Fix 'async def' highlighting. Patch by Joongi Kim
4
+    - Add dummy 'pythonInclude' group to avoid crashing standard pyrex.vim.
5
+      Patch by Antony Lee
6
+
1
 Revision 3.5.0 (2015-06-10):
7
 Revision 3.5.0 (2015-06-10):
2
 
8
 
3
     - Add support for 'async ...' and 'await' keywords introduced in
9
     - Add support for 'async ...' and 'await' keywords introduced in

+ 2
- 0
README.rst View File

132
 
132
 
133
 - `Andrea Riciputi <https://github.com/mrrech>`_
133
 - `Andrea Riciputi <https://github.com/mrrech>`_
134
 - Anton Butanaev
134
 - Anton Butanaev
135
+- `Antony Lee <https://github.com/anntzer>`_
135
 - Caleb Adamantine
136
 - Caleb Adamantine
136
 - `David Briscoe <https://github.com/idbrii>`_
137
 - `David Briscoe <https://github.com/idbrii>`_
137
 - `Elizabeth Myers <https://github.com/Elizafox>`_
138
 - `Elizabeth Myers <https://github.com/Elizafox>`_
138
 - `Ihor Gorobets <https://github.com/iho>`_
139
 - `Ihor Gorobets <https://github.com/iho>`_
139
 - `Jeroen Ruigrok van der Werven <https://github.com/ashemedai>`_
140
 - `Jeroen Ruigrok van der Werven <https://github.com/ashemedai>`_
140
 - `John Eikenberry <https://github.com/eikenb>`_
141
 - `John Eikenberry <https://github.com/eikenb>`_
142
+- `Joongi Kim <https://github.com/achimnol>`_
141
 - `Marc Weber <https://github.com/MarcWeber>`_
143
 - `Marc Weber <https://github.com/MarcWeber>`_
142
 - `Pedro Algarvio <https://github.com/s0undt3ch>`_
144
 - `Pedro Algarvio <https://github.com/s0undt3ch>`_
143
 - `Victor Salgado <https://github.com/mcsalgado>`_
145
 - `Victor Salgado <https://github.com/mcsalgado>`_

+ 8
- 4
syntax/python.vim View File

3
 " Current Maintainer:   Dmitry Vasiliev <dima at hlabs dot org>
3
 " Current Maintainer:   Dmitry Vasiliev <dima at hlabs dot org>
4
 " Previous Maintainer:  Neil Schemenauer <nas at python dot ca>
4
 " Previous Maintainer:  Neil Schemenauer <nas at python dot ca>
5
 " URL:                  https://github.com/hdima/python-syntax
5
 " URL:                  https://github.com/hdima/python-syntax
6
-" Last Change:          2015-06-10
6
+" Last Change:          2015-11-01
7
 " Filenames:            *.py
7
 " Filenames:            *.py
8
-" Version:              3.5.0
8
+" Version:              3.6.0
9
 "
9
 "
10
 " Based on python.vim (from Vim 6.1 distribution)
10
 " Based on python.vim (from Vim 6.1 distribution)
11
 " by Neil Schemenauer <nas at python dot ca>
11
 " by Neil Schemenauer <nas at python dot ca>
25
 "
25
 "
26
 "   Andrea Riciputi
26
 "   Andrea Riciputi
27
 "   Anton Butanaev
27
 "   Anton Butanaev
28
+"   Antony Lee
28
 "   Caleb Adamantine
29
 "   Caleb Adamantine
29
 "   David Briscoe
30
 "   David Briscoe
30
 "   Elizabeth Myers
31
 "   Elizabeth Myers
31
 "   Ihor Gorobets
32
 "   Ihor Gorobets
32
 "   Jeroen Ruigrok van der Werven
33
 "   Jeroen Ruigrok van der Werven
33
 "   John Eikenberry
34
 "   John Eikenberry
35
+"   Joongi Kim
34
 "   Marc Weber
36
 "   Marc Weber
35
 "   Pedro Algarvio
37
 "   Pedro Algarvio
36
 "   Victor Salgado
38
 "   Victor Salgado
157
 syn keyword pythonStatement     def class nextgroup=pythonFunction skipwhite
159
 syn keyword pythonStatement     def class nextgroup=pythonFunction skipwhite
158
 syn keyword pythonRepeat        for while
160
 syn keyword pythonRepeat        for while
159
 syn keyword pythonConditional   if elif else
161
 syn keyword pythonConditional   if elif else
162
+" The standard pyrex.vim unconditionally removes the pythonInclude group, so
163
+" we provide a dummy group here to avoid crashing pyrex.vim.
164
+syn keyword pythonInclude       import
160
 syn keyword pythonImport        import
165
 syn keyword pythonImport        import
161
 syn keyword pythonException     try except finally
166
 syn keyword pythonException     try except finally
162
 syn keyword pythonOperator      and in is not or
167
 syn keyword pythonOperator      and in is not or
176
   syn keyword pythonBoolean     True False
181
   syn keyword pythonBoolean     True False
177
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
182
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
178
   syn keyword pythonStatement   await
183
   syn keyword pythonStatement   await
179
-  syn match   pythonStatement   "\<async\s\+def\>" display
184
+  syn match   pythonStatement   "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
180
   syn match   pythonStatement   "\<async\s\+with\>" display
185
   syn match   pythonStatement   "\<async\s\+with\>" display
181
   syn match   pythonStatement   "\<async\s\+for\>" display
186
   syn match   pythonStatement   "\<async\s\+for\>" display
182
-  syn match   pythonStatement   "\<async\s\+with\>" display
183
 endif
187
 endif
184
 
188
 
185
 "
189
 "

+ 5
- 0
test.py View File

18
 def функция
18
 def функция
19
 class Класс
19
 class Класс
20
 
20
 
21
+await
22
+async def Test
23
+async with
24
+async for
25
+
21
 # Builtin objects.
26
 # Builtin objects.
22
 
27
 
23
 True False Ellipsis None NotImplemented
28
 True False Ellipsis None NotImplemented