Skip to content

Commit 952c75d

Browse files
committed
Add support for match expression
This is based on the work of [@g15ecb](https://github.com/g15ecb) g15ecb@988efe9
1 parent 2cc00ba commit 952c75d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntax/python.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ if s:Enabled('g:python_highlight_class_vars')
8181
endif
8282
syn keyword pythonRepeat for while
8383
syn keyword pythonConditional if elif else
84+
syn keyword pythonMatch match case
8485
syn keyword pythonException try except finally
8586
" The standard pyrex.vim unconditionally removes the pythonInclude group, so
8687
" we provide a dummy group here to avoid crashing pyrex.vim.
@@ -105,7 +106,7 @@ else
105106
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
106107
syn match pythonStatement '\<async\s\+with\>'
107108
syn match pythonStatement '\<async\s\+for\>'
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
109+
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonMatch,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonFString,pythonRawString,pythonRawFString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType,pythonClassVar
109110
endif
110111

111112

@@ -434,6 +435,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
434435
HiLink pythonFunction Function
435436
HiLink pythonFunctionCall Function
436437
HiLink pythonConditional Conditional
438+
HiLink pythonMatch Conditional
437439
HiLink pythonRepeat Repeat
438440
HiLink pythonException Exception
439441
HiLink pythonOperator Operator

0 commit comments

Comments
 (0)