From: Doug Kearns Date: Sun, 1 Feb 2026 15:03:46 +0000 (+0000) Subject: runtime(vim): Update base syntax, match Vim9 :unlet command X-Git-Tag: v9.1.2126~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4c98b6f3db7d8e43645ccdf0b293cb07507ee1;p=thirdparty%2Fvim.git runtime(vim): Update base syntax, match Vim9 :unlet command closes: #19290 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index afde79fbbc..0a4da554a8 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2026 Jan 11 +" Last Change: 2026 Jan 30 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -1167,11 +1167,11 @@ syn region vimLetVarSubscript contained \ skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc \ contains=@vimExprList -VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars +syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars syn region vimUnletVars contained - \ start="$\I\|\h" skip=+\n\s*\%(\\\|"\\ \)\|^\s*"\\ + end="$" end="\ze[|"]" - \ nextgroup=vimCmdSep,vimComment + \ start="$\I\|\h" skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*["#]\\ + end="$" end=+\ze\s*[|"#]+ + \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar " TODO: type error after register or environment variables (strings) diff --git a/runtime/syntax/testdir/dumps/vim9_variables_02.dump b/runtime/syntax/testdir/dumps/vim9_variables_02.dump index ee7035ed87..1c315aee23 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_02.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_02.dump @@ -17,4 +17,4 @@ |E+0#e000e06&|N|D| +0#0000000&@71 @75 |#+0#0000e05&| |T|y|p|e|d| |d|e|c|l|a|r|a|t|i|o|n|s| +0#0000000&@54 -@57|3|7|,|1| @9|1|4|%| +@57|3|7|,|1| @9|1|2|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_03.dump b/runtime/syntax/testdir/dumps/vim9_variables_03.dump index d390975f59..bb0a3660ba 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_03.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_03.dump @@ -17,4 +17,4 @@ @6|\+0#e000e06&|>+0#00e0003&| +0#0000000&@66 @75 |#+0#0000e05&| |A|s@1|i|g|n|m|e|n|t|s| +0#0000000&@61 -@57|5@1|,|1| @9|2@1|%| +@57|5@1|,|1| @9|1|9|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_04.dump b/runtime/syntax/testdir/dumps/vim9_variables_04.dump index a519e7eb55..09eecdfa63 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_04.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_04.dump @@ -17,4 +17,4 @@ |f+0#00e0e07&|o@1| +0#0000000&|*+0#af5f00255&|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@63 |f+0#00e0e07&|o@1| +0#0000000&|/+0#af5f00255&|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@63 |f+0#00e0e07&|o@1| +0#0000000&|%+0#af5f00255&|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@63 -@57|7|3|,|0|-|1| @7|3|0|%| +@57|7|3|,|0|-|1| @7|2|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_05.dump b/runtime/syntax/testdir/dumps/vim9_variables_05.dump index ce50a1a912..53f4fe1dd2 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_05.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_05.dump @@ -17,4 +17,4 @@ |w+0#00e0e07&|:|f|o@1| +0#0000000&|-+0#af5f00255&|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@61 @75 |b+0#00e0e07&|:|f|o@1| +0#0000000&|*+0#af5f00255&|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@61 -@57|9|1|,|1| @9|3|8|%| +@57|9|1|,|1| @9|3|4|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_06.dump b/runtime/syntax/testdir/dumps/vim9_variables_06.dump index 760852e29a..898f64284c 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_06.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_06.dump @@ -17,4 +17,4 @@ |g+0#00e0e07&|:|f|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@60 |t+0#00e0e07&|:|f|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@60 |w+0#00e0e07&|:|f|o@1| +0#0000000&|.+0#af5f00255&@1|=| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@60 -@57|1|0|9|,|1| @8|4|6|%| +@57|1|0|9|,|1| @8|4|1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_07.dump b/runtime/syntax/testdir/dumps/vim9_variables_07.dump index 9b324b42d0..f0aadcbbd1 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_07.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_07.dump @@ -17,4 +17,4 @@ @75 |&+0#00e0e07&|l|:|a|l|e|p|h| +0#0000000&|=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@59 @75 -@57|1|2|7|,|1| @8|5|4|%| +@57|1|2|7|,|1| @8|4|8|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_08.dump b/runtime/syntax/testdir/dumps/vim9_variables_08.dump index 55d9050e44..cb8f53f0d3 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_08.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_08.dump @@ -17,4 +17,4 @@ @6|\| |v+0#00e0e07&|:|f|a|l|s|e|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@51 |[|&+0#00e0e07&|a|r|i|,+0#0000000&| |&+0#00e0e07&|b|k|c|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@55 |[|&+0#00e0e07&|a|r|i|,+0#0000000&| @68 -@57|1|4|5|,|1| @8|6|2|%| +@57|1|4|5|,|1| @8|5@1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_09.dump b/runtime/syntax/testdir/dumps/vim9_variables_09.dump index 48273c051e..9515d52442 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_09.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_09.dump @@ -17,4 +17,4 @@ |[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|;+0#0000000&| |b+0#00e0e07&|a|z|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@52 |[|f+0#00e0e07&|o@1|,+0#0000000&| @69 @6|\| |b+0#00e0e07&|a|r|;+0#0000000&| @62 -@57|1|6|3|,|1| @8|7|1|%| +@57|1|6|3|,|1| @8|6|2|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_10.dump b/runtime/syntax/testdir/dumps/vim9_variables_10.dump index baf1f9e4ff..10f79433d4 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_10.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_10.dump @@ -17,4 +17,4 @@ @6|\| |@+0#e000e06&|b|;+0#0000000&| @63 @6|\| |@+0#e000e06&|c|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@56 @75 -@57|1|8|1|,|7| @8|7|9|%| +@57|1|8|1|,|7| @8|7|0|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_11.dump b/runtime/syntax/testdir/dumps/vim9_variables_11.dump index 234b3dd513..ebaabb82ef 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_11.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_11.dump @@ -15,6 +15,6 @@ |.+0#e000002&@2| +0#0000000&@71 |E+0#e000e06&|N|D| +0#0000000&@71 @75 -|#+0#0000e05&| |:|f|o|r| +0#0000000&@68 +|#+0#0000e05&| |:|u|n|l|e|t| +0#0000000&@66 @75 -@57|1|9@1|,|1| @8|8|7|%| +@57|1|9@1|,|1| @8|7@1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_12.dump b/runtime/syntax/testdir/dumps/vim9_variables_12.dump index 7a6baece81..642e30b2cc 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_12.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_12.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 -|f+0#af5f00255&|o|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@59 -|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@61 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@65 +@6|#+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6>\+0#e000e06&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@63 @75 -|f+0#af5f00255&|o|r| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@52 ->e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@64 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@60 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@64 +@6|#+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@63 @75 -|#+0#0000e05&| |S|c|o|p|e| |d|i|c|t|i|o|n|a|r|i|e|s| +0#0000000&@54 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@64 +|u+0#af5f00255&|n|l|e|t|!| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@63 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|b+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 -|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|w+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 -|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|t+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 -|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|g+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 -|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|v+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 -@75 -|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|b+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|b+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 -|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|w+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|w+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 -|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|t+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 -|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|g+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 -@57|2|1|7|,|1| @8|9|5|%| +|u+0#af5f00255&|n|l|e|t| +0#0000000&|l+0#00e0e07&|i|s|t|[+0#0000000&|3+0#e000002&|]+0#0000000&| @61 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|l+0#00e0e07&|i|s|t|[+0#0000000&|3+0#e000002&|:+0#0000000&|]| @60 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|d+0#00e0e07&|i|c|t|[+0#0000000&|'+0#e000002&|t|w|o|'|]+0#0000000&| @57 +@57|2|1|7|,|7| @8|8|4|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_13.dump b/runtime/syntax/testdir/dumps/vim9_variables_13.dump index 851fa0792f..638d2b6082 100644 --- a/runtime/syntax/testdir/dumps/vim9_variables_13.dump +++ b/runtime/syntax/testdir/dumps/vim9_variables_13.dump @@ -1,20 +1,20 @@ -|f+0#af5f00255#ffffff0|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|g+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 -|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|v+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|v+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +|u+0#af5f00255#ffffff0|n|l|e|t| +0#0000000&|d+0#00e0e07&|i|c|t|[+0#0000000&|'+0#e000002&|t|w|o|'|]+0#0000000&| @57 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|d+0#00e0e07&|i|c|t|.+0#0000000&|t+0#00e0e07&|w|o| +0#0000000&@60 @75 -|#+0#0000e05&| |N|e|o|v|i|m|-|s|p|e|c|i|f|i|c| |v|a|r|i|a|b|l|e|s| |(|n|o|t| |h|i|g|h|l|i|g|h|t|e|d| |b|y| |d|e|f|a|u|l|t|)| +0#0000000&@18 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@55 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|#+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@54 +>u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@52 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@51 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|#+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@50 +|u+0#af5f00255&|n|l|e|t| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@48 @75 ->e+0#af5f00255&|c|h|o| +0#0000000&|v+0#00e0e07&|:|l+0#0000000&|u|a| |v+0#00e0e07&|:|m+0#0000000&|s|g|p|a|c|k|_|t|y|p|e|s| |v+0#00e0e07&|:|r+0#0000000&|e|l|n|u|m| |v+0#00e0e07&|:|s+0#0000000&|t|d|e|r@1| |v+0#00e0e07&|:|t+0#0000000&|e|r|m|r|e|q|u|e|s|t| |v+0#00e0e07&|:|v+0#0000000&|i|r|t|n|u|m| @6 +|#+0#0000e05&| |:|f|o|r| +0#0000000&@68 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|c+0#0000000&|h|a|n@1|e|l| |&+0#00e0e07&|i+0#0000000&|n|c@1|o|m@1|a|n|d| |&+0#00e0e07&|m+0#0000000&|o|u|s|e|s|c|r|o|l@1| |&+0#00e0e07&|p+0#0000000&|u|m|b|l|e|n|d| |&+0#00e0e07&|r+0#0000000&|e|d|r|a|w|d|e|b|u|g| |&+0#00e0e07&|s+0#0000000&|c|r|o|l@1|b|a|c|k| @1 -|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|s+0#0000000&|h|a|d|a| |&+0#00e0e07&|s+0#0000000&|h|a|d|a|f|i|l|e| |&+0#00e0e07&|s+0#0000000&|t|a|t|u|s|c|o|l|u|m|n| |&+0#00e0e07&|t+0#0000000&|e|r|m|p|a|s|t|e|f|i|l|t|e|r| |&+0#00e0e07&|t+0#0000000&|e|r|m|s|y|n|c| |&+0#00e0e07&|w+0#0000000&|i|n|b|a|r| @3 -|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|w+0#0000000&|i|n|b|l|e|n|d| |&+0#00e0e07&|w+0#0000000&|i|n|h|i|g|h|l|i|g|h|t| @46 +|f+0#af5f00255&|o|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@59 +|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|2|3|5|,|1| @8|B|o|t| +|f+0#af5f00255&|o|r| +0#0000000&|[|f+0#00e0e07&|o@1|,+0#0000000&| |b+0#00e0e07&|a|r|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@52 +|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68 +@75 +|#+0#0000e05&| |S|c|o|p|e| |d|i|c|t|i|o|n|a|r|i|e|s| +0#0000000&@54 +@57|2|3|5|,|1| @8|9|1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_14.dump b/runtime/syntax/testdir/dumps/vim9_variables_14.dump new file mode 100644 index 0000000000..afe83a8d7b --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_variables_14.dump @@ -0,0 +1,20 @@ +|#+0#0000e05#ffffff0| |S|c|o|p|e| |d|i|c|t|i|o|n|a|r|i|e|s| +0#0000000&@54 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|b+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|w+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|t+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 +>e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|g+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|e|t|(+0#e000e06&|v+0#00e0e07&|:|,+0#0000000&| |'+0#e000002&|f|o@1|'|,+0#0000000&| |4+0#e000002&|2|)+0#e000e06&| +0#0000000&@51 +@75 +|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|b+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|b+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|w+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|w+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|t+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|g+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +|f+0#af5f00255&|o|r| +0#0000000&|k+0#00e0e07&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|k+0#00e0e07&|e|y|s|(+0#e000e06&|v+0#00e0e07&|:|)+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|v+0#00e0e07&|:|[+0#0000000&|k+0#00e0e07&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@35 +@75 +|#+0#0000e05&| |N|e|o|v|i|m|-|s|p|e|c|i|f|i|c| |v|a|r|i|a|b|l|e|s| |(|n|o|t| |h|i|g|h|l|i|g|h|t|e|d| |b|y| |d|e|f|a|u|l|t|)| +0#0000000&@18 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|v+0#00e0e07&|:|l+0#0000000&|u|a| |v+0#00e0e07&|:|m+0#0000000&|s|g|p|a|c|k|_|t|y|p|e|s| |v+0#00e0e07&|:|r+0#0000000&|e|l|n|u|m| |v+0#00e0e07&|:|s+0#0000000&|t|d|e|r@1| |v+0#00e0e07&|:|t+0#0000000&|e|r|m|r|e|q|u|e|s|t| |v+0#00e0e07&|:|v+0#0000000&|i|r|t|n|u|m| @6 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|c+0#0000000&|h|a|n@1|e|l| |&+0#00e0e07&|i+0#0000000&|n|c@1|o|m@1|a|n|d| |&+0#00e0e07&|m+0#0000000&|o|u|s|e|s|c|r|o|l@1| |&+0#00e0e07&|p+0#0000000&|u|m|b|l|e|n|d| |&+0#00e0e07&|r+0#0000000&|e|d|r|a|w|d|e|b|u|g| |&+0#00e0e07&|s+0#0000000&|c|r|o|l@1|b|a|c|k| @1 +@57|2|5|3|,|1| @8|9|8|%| diff --git a/runtime/syntax/testdir/dumps/vim9_variables_15.dump b/runtime/syntax/testdir/dumps/vim9_variables_15.dump new file mode 100644 index 0000000000..095bdb0fd8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_variables_15.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|&+0#00e0e07&|c+0#0000000&|h|a|n@1|e|l| |&+0#00e0e07&|i+0#0000000&|n|c@1|o|m@1|a|n|d| |&+0#00e0e07&|m+0#0000000&|o|u|s|e|s|c|r|o|l@1| |&+0#00e0e07&|p+0#0000000&|u|m|b|l|e|n|d| |&+0#00e0e07&|r+0#0000000&|e|d|r|a|w|d|e|b|u|g| |&+0#00e0e07&|s+0#0000000&|c|r|o|l@1|b|a|c|k| @1 +|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|s+0#0000000&|h|a|d|a| |&+0#00e0e07&|s+0#0000000&|h|a|d|a|f|i|l|e| |&+0#00e0e07&|s+0#0000000&|t|a|t|u|s|c|o|l|u|m|n| |&+0#00e0e07&|t+0#0000000&|e|r|m|p|a|s|t|e|f|i|l|t|e|r| |&+0#00e0e07&|t+0#0000000&|e|r|m|s|y|n|c| |&+0#00e0e07&|w+0#0000000&|i|n|b|a|r| @3 +|e+0#af5f00255&|c|h|o| +0#0000000&|&+0#00e0e07&|w+0#0000000&|i|n|b|l|e|n|d| |&+0#00e0e07&|w+0#0000000&|i|n|h|i|g|h|l|i|g|h|t| @46 +> @74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|2|6|9|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/input/vim9_variables.vim b/runtime/syntax/testdir/input/vim9_variables.vim index 8347bd7eee..7344db8ce1 100644 --- a/runtime/syntax/testdir/input/vim9_variables.vim +++ b/runtime/syntax/testdir/input/vim9_variables.vim @@ -208,6 +208,35 @@ foo =<< eval trim END ... END +# :unlet + +unlet foo +unlet foo bar +unlet foo + #\ comment + \ bar + +unlet! foo +unlet! foo bar +unlet! foo + #\ comment + \ bar + +unlet $FOO +unlet! $FOO + +unlet list[3] +unlet list[3:] +unlet dict['two'] +unlet dict.two + +unlet foo # comment +unlet foo #\ comment +unlet foo | echo "Foo" +unlet foo bar # comment +unlet foo bar #\ comment +unlet foo bar | echo "Foo" + # :for for foo in expr diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 03f466c46e..22f563fafd 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2026 Jan 11 +" Last Change: 2026 Jan 30 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -1224,11 +1224,11 @@ syn region vimLetVarSubscript contained \ skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc \ contains=@vimExprList -VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars +syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars syn region vimUnletVars contained - \ start="$\I\|\h" skip=+\n\s*\%(\\\|"\\ \)\|^\s*"\\ + end="$" end="\ze[|"]" - \ nextgroup=vimCmdSep,vimComment + \ start="$\I\|\h" skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*["#]\\ + end="$" end=+\ze\s*[|"#]+ + \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar " TODO: type error after register or environment variables (strings)