74
74
75
75
syn keyword pythonStatement break continue del return pass yield global assert lambda with
76
76
syn keyword pythonStatement raise nextgroup =pythonExClass skipwhite
77
- syn keyword pythonStatement def class nextgroup =pythonFunction skipwhite
77
+ syn keyword pythonStatement def nextgroup =pythonFunction skipwhite
78
+ syn keyword pythonStatement class nextgroup =pythonClass skipwhite
78
79
if s: Enabled (' g:python_highlight_class_vars' )
79
- syn keyword pythonClassVar self cls
80
+ syn keyword pythonClassVar self cls mcs
80
81
endif
81
82
syn keyword pythonRepeat for while
82
83
syn keyword pythonConditional if elif else
@@ -100,10 +101,11 @@ else
100
101
syn keyword pythonStatement as nonlocal
101
102
syn match pythonStatement ' \v\. @<!<await>'
102
103
syn match pythonFunction ' \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *' display contained
104
+ syn match pythonClass ' \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *' display contained
103
105
syn match pythonStatement ' \< async\s\+ def\> ' nextgroup =pythonFunction skipwhite
104
106
syn match pythonStatement ' \< async\s\+ with\> '
105
107
syn match pythonStatement ' \< async\s\+ for\> '
106
- syn cluster pythonExpression contains =pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType
108
+ syn cluster pythonExpression contains =pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString, pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType,pythonClassVar
107
109
endif
108
110
109
111
@@ -112,7 +114,7 @@ endif
112
114
"
113
115
syn keyword pythonOperator and in is not or
114
116
if s: Enabled (' g:python_highlight_operators' )
115
- syn match pythonOperator ' \V =\| -\| +\| *\| @\| /\| %\| &\| |\| ^\| ~\| <\| >\| !='
117
+ syn match pythonOperator ' \V =\| -\| +\| *\| @\| /\| %\| &\| |\| ^\| ~\| <\| >\| !=\| := '
116
118
endif
117
119
syn match pythonError ' [$?]\|\( [-+@%&|^~]\)\1\{ 1,}\|\( [=*/<>]\)\2\{ 2,}\|\( [+@/%&|^~<>]\)\3\@ ![-+*@/%&|^~<>]\|\*\* [*@/%&|^<>]\| =[*@/%&|^<>]\| -[+*@/%&|^~<]\| [<!>]\+ =\{ 2,}\| !\{ 2,}=\+ ' display
118
120
@@ -263,8 +265,8 @@ if s:Enabled('g:python_highlight_string_format')
263
265
syn match pythonStrFormat ' {{\| }}' contained containedin =pythonString,pythonMultiString,pythonUniString,pythonUniMultiString,pythonUniRawString,pythonRawString
264
266
syn match pythonStrFormat ' {\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\)\=\% (\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\[\% (\d\+\| [^!:\} ]\+\)\]\) *\% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }' contained containedin =pythonString,pythonMultiString,pythonUniString,pythonUniMultiString,pythonUniRawString,pythonRawString
265
267
else
266
- syn match pythonStrFormat " {\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\)\=\% (\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\[\% (\d\+\| [^!:\} ]\+\)\]\) *\% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" contained containedin =pythonString,pythonMultiString, pythonRawString
267
- syn region pythonStrInterpRegion start =" {" he = e + 1 , rs = e + 1 end =" \% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" hs = s - 1 , re = s - 1 extend contained containedin =pythonFString,pythonRawFString contains =pythonStrInterpRegion,@pythonExpression
268
+ syn match pythonStrFormat " {\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\)\=\% (\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\[\% (\d\+\| [^!:\} ]\+\)\]\) *\% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" contained containedin =pythonString,pythonRawString
269
+ syn region pythonStrInterpRegion matchgroup = pythonStrFormat start =" {" end =" \% (![rsa]\)\=\% (:\% ({\% (\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\|\d\+\) }\|\% ([^}]\= [<>=^]\)\= [ +-]\= #\= 0\=\d *,\=\% (\.\d\+\)\= [bcdeEfFgGnosxX%]\=\)\=\)\= }" extend contained containedin =pythonFString,pythonRawFString contains =pythonStrInterpRegion,@pythonExpression
268
270
syn match pythonStrFormat " {{\| }}" contained containedin =pythonString,pythonMultiString,pythonRawString,pythonFString,pythonRawFString
269
271
endif
270
272
endif
@@ -473,7 +475,6 @@ if v:version >= 508 || !exists('did_python_syn_inits')
473
475
HiLink pythonBytesEscapeError Error
474
476
HiLink pythonFString String
475
477
HiLink pythonRawFString String
476
- HiLink pythonStrInterpRegion Special
477
478
endif
478
479
479
480
HiLink pythonStrFormatting Special
@@ -502,6 +503,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
502
503
HiLink pythonBuiltinType Structure
503
504
504
505
HiLink pythonExClass Structure
506
+ HiLink pythonClass Structure
505
507
HiLink pythonClassVar Identifier
506
508
507
509
delcommand HiLink
0 commit comments