|
@@ -154,7 +154,6 @@ syn keyword pythonStatement break continue del
|
154
|
154
|
syn keyword pythonStatement exec return
|
155
|
155
|
syn keyword pythonStatement pass raise
|
156
|
156
|
syn keyword pythonStatement global assert
|
157
|
|
-syn keyword pythonStatement lambda
|
158
|
157
|
syn keyword pythonStatement with
|
159
|
158
|
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
160
|
159
|
syn keyword pythonRepeat for while
|
|
@@ -166,12 +165,15 @@ syn keyword pythonImport import
|
166
|
165
|
syn match pythonIdentifier "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" nextgroup=pythonFuncArgs,pythonTypeAnno display
|
167
|
166
|
syn keyword pythonException try except finally
|
168
|
167
|
syn keyword pythonOperator and in is not or
|
|
168
|
+syn match pythonLambdaExpr "\<lambda[^:]*:"he=s+6 display nextgroup=@pythonExpression
|
|
169
|
+"syn keyword pythonStatement lambda
|
169
|
170
|
|
170
|
171
|
syn region pythonDictSetExpr matchgroup=pythonDictSetExpr start='{' end='}' contains=@pythonExpression
|
|
172
|
+syn region pythonListSliceExpr matchgroup=pythonListSliceExpr start='\[' end='\]' contains=@pythonExpression
|
171
|
173
|
syn region pythonFuncArgs matchgroup=pythonFuncArgs start='(' end=')' contained contains=pythonTypeAnno,@pythonExpression
|
172
|
174
|
|
173
|
175
|
syn match pythonTypeAnno ":\s*\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"hs=s+1 display contained contains=pythonType nextgroup=pythonTypeArgs
|
174
|
|
-syn match pythonTypeAnnoReturn "->\s*\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"hs=s+2,he=e-1 display contains=pythonType nextgroup=pythonTypeArgs
|
|
176
|
+syn match pythonTypeAnnoReturn "->\s*\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contains=pythonType nextgroup=pythonTypeArgs
|
175
|
177
|
syn region pythonTypeArgs matchgroup=pythonTypeArgs start='\[' end='\]' display contained contains=pythonType,pythonTypeArgs
|
176
|
178
|
syn keyword pythonType Any AnyStr Callable ClassVar Tuple Union Optional Type TypeVar None contained
|
177
|
179
|
syn keyword pythonType AbstractSet MutableSet Mapping MutableMapping Sequence MutableSequence ByteString Deque List contained
|
|
@@ -203,6 +205,8 @@ endif
|
203
|
205
|
syn cluster pythonExpression contains=
|
204
|
206
|
\ pythonFuncArgs,
|
205
|
207
|
\ pythonDictSetExpr,
|
|
208
|
+ \ pythonListSliceExpr,
|
|
209
|
+ \ pythonLambdaExpr,
|
206
|
210
|
\ pythonStatement,
|
207
|
211
|
\ pythonRepeat,
|
208
|
212
|
\ pythonConditional,
|
|
@@ -225,6 +229,9 @@ syn cluster pythonExpression contains=
|
225
|
229
|
|
226
|
230
|
syn cluster pythonFExpression contains=
|
227
|
231
|
\ pythonStatement,
|
|
232
|
+ \ pythonDictSetExpr,
|
|
233
|
+ \ pythonListSliceExpr,
|
|
234
|
+ \ pythonLambdaExpr,
|
228
|
235
|
\ pythonRepeat,
|
229
|
236
|
\ pythonConditional,
|
230
|
237
|
\ pythonOperator,
|
|
@@ -559,6 +566,7 @@ if version >= 508 || !exists("did_python_syn_inits")
|
559
|
566
|
endif
|
560
|
567
|
|
561
|
568
|
HiLink pythonStatement Statement
|
|
569
|
+ HiLink pythonLambdaExpr Statement
|
562
|
570
|
HiLink pythonImport Include
|
563
|
571
|
HiLink pythonFunction Function
|
564
|
572
|
HiLink pythonConditional Conditional
|