aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/python.vim
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-07-30 15:48:32 +0200
committerGitHub <noreply@github.com>2022-07-30 15:48:32 +0200
commit6237ac84024f048ec60475276fbf0663d9d17879 (patch)
treea26df8962b063f73b4c85e9906b2e2edb54fb73c /runtime/syntax/python.vim
parentd36d9be8ff0e03a7cbba087abb9167056f9c56c7 (diff)
downloadrneovim-6237ac84024f048ec60475276fbf0663d9d17879.tar.gz
rneovim-6237ac84024f048ec60475276fbf0663d9d17879.tar.bz2
rneovim-6237ac84024f048ec60475276fbf0663d9d17879.zip
vim-patch:2ecbe53f452e (#19577)
Update runtime files https://github.com/vim/vim/commit/2ecbe53f452e92e941aff623f6a0b72f80e43d07
Diffstat (limited to 'runtime/syntax/python.vim')
-rw-r--r--runtime/syntax/python.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 2293163a5b..ef4da1b448 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Python
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
-" Last Change: 2021 Dec 10
+" Last Change: 2022 Jun 28
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
"
@@ -84,13 +84,19 @@ syn keyword pythonStatement as assert break continue del global
syn keyword pythonStatement lambda nonlocal pass return with yield
syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
syn keyword pythonConditional elif else if
-syn keyword pythonConditional case match
syn keyword pythonRepeat for while
syn keyword pythonOperator and in is not or
syn keyword pythonException except finally raise try
syn keyword pythonInclude from import
syn keyword pythonAsync async await
+" Soft keywords
+" These keywords do not mean anything unless used in the right context
+" See https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
+" for more on this.
+syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@="
+syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@="
+
" Decorators
" A dot must be allowed because of @MyClass.myfunc decorators.
syn match pythonDecorator "@" display contained