|
|
|
|
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-11-01
|
|
|
|
|
6
|
+" Last Change: 2016-07-30
|
7
|
" Filenames: *.py
|
7
|
" Filenames: *.py
|
8
|
-" Version: 3.6.0
|
|
|
|
|
8
|
+" Version: 3.6.1
|
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>
|
|
|
|
|
38
|
" Victor Salgado
|
38
|
" Victor Salgado
|
39
|
" Will Gray
|
39
|
" Will Gray
|
40
|
" Yuri Habrusiev
|
40
|
" Yuri Habrusiev
|
|
|
41
|
+" Arthur Jaron
|
41
|
"
|
42
|
"
|
42
|
" Options
|
43
|
" Options
|
43
|
" =======
|
44
|
" =======
|
|
|
|
|
276
|
syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
|
277
|
syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell
|
277
|
syn region pythonString start=+"""+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
278
|
syn region pythonString start=+"""+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
278
|
syn region pythonString start=+'''+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
279
|
syn region pythonString start=+'''+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
|
|
280
|
+
|
279
|
endif
|
281
|
endif
|
280
|
|
282
|
|
|
|
283
|
+syn region pythonDocstring start=+^\s*[uU]\?[rR]\?"""+ end=+"""+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError
|
|
|
284
|
+syn region pythonDocstring start=+^\s*[uU]\?[rR]\?'''+ end=+'''+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError
|
|
|
285
|
+
|
281
|
if s:Python2Syntax()
|
286
|
if s:Python2Syntax()
|
282
|
" Python 2 Unicode raw strings
|
287
|
" Python 2 Unicode raw strings
|
283
|
syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
|
288
|
syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
|
|
|
|
|
368
|
syn match pythonNumber "\<[0-9]\d\+[lL]\=\>" display
|
373
|
syn match pythonNumber "\<[0-9]\d\+[lL]\=\>" display
|
369
|
syn match pythonNumber "\<\d\+[lLjJ]\>" display
|
374
|
syn match pythonNumber "\<\d\+[lLjJ]\>" display
|
370
|
|
375
|
|
|
|
376
|
+ " For completeness
|
|
|
377
|
+ syn match pythonNumber "\<-\d[lL]\=\>" display
|
|
|
378
|
+ syn match pythonNumber "\<-[0-9]\d\+[lL]\=\>" display
|
|
|
379
|
+ syn match pythonNumber "\<-\d\+[lLjJ]\>" display
|
|
|
380
|
+
|
371
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
|
381
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
|
372
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
|
382
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
|
373
|
else
|
383
|
else
|
|
|
|
|
385
|
syn match pythonNumber "\<[1-9]\d\+\>" display
|
395
|
syn match pythonNumber "\<[1-9]\d\+\>" display
|
386
|
syn match pythonNumber "\<\d\+[jJ]\>" display
|
396
|
syn match pythonNumber "\<\d\+[jJ]\>" display
|
387
|
|
397
|
|
|
|
398
|
+ " Negative numbers, why missing?
|
|
|
399
|
+ syn match pythonNumber "\<-\d\>" display
|
|
|
400
|
+ syn match pythonNumber "\<-[1-9]\d\+\>" display
|
|
|
401
|
+ syn match pythonNumber "\<-\d\+[jJ]\>" display
|
|
|
402
|
+
|
388
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display
|
403
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display
|
389
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" display
|
404
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" display
|
390
|
endif
|
405
|
endif
|
|
|
|
|
402
|
syn keyword pythonBuiltinObj None
|
417
|
syn keyword pythonBuiltinObj None
|
403
|
syn keyword pythonBoolean True False
|
418
|
syn keyword pythonBoolean True False
|
404
|
endif
|
419
|
endif
|
405
|
- syn keyword pythonBuiltinObj Ellipsis NotImplemented
|
|
|
|
|
420
|
+ syn keyword pythonBuiltinObj Ellipsis NotImplemented self
|
406
|
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
421
|
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
407
|
endif
|
422
|
endif
|
408
|
|
423
|
|
|
|
|
|
521
|
HiLink pythonString String
|
536
|
HiLink pythonString String
|
522
|
HiLink pythonRawString String
|
537
|
HiLink pythonRawString String
|
523
|
|
538
|
|
|
|
539
|
+ HiLink pythonDocstring Docstring
|
|
|
540
|
+
|
524
|
HiLink pythonUniEscape Special
|
541
|
HiLink pythonUniEscape Special
|
525
|
HiLink pythonUniEscapeError Error
|
542
|
HiLink pythonUniEscapeError Error
|
526
|
|
543
|
|