runtime(vim): Update base syntax, fix Vim9 :for loop variable highlighting
Highlight the iteration variable's type in Vim9 :for {var} loops.
Reported by Aliaksei Budavei.
fixes: #17961
closes: #18163
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
68f681c6ab
commit
6f97624e11
@ -15,6 +15,6 @@
|
||||
@75
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|[+0#e000e06&|4+0#e000002&|2|]+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@39
|
||||
@75
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|f+0#00e0e07&|o@1|:+0#0000000&| |n+0#00e0e07&|u|m|b|e|r| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|[+0#e000e06&|4+0#e000002&|2|]+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@31
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|f+0#00e0e07&|o@1|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|[+0#e000e06&|4+0#e000002&|2|]+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@31
|
||||
@75
|
||||
@57|1|9|,|7| @9|2|7|%|
|
||||
@57|1|9|,|7| @9|1|8|%|
|
||||
|
||||
@ -17,4 +17,4 @@
|
||||
|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68
|
||||
@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&@57
|
||||
@57|3|7|,|0|-|1| @7|6|4|%|
|
||||
@57|3|7|,|0|-|1| @7|4@1|%|
|
||||
|
||||
@ -16,5 +16,5 @@
|
||||
@2|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@60
|
||||
|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68
|
||||
@75
|
||||
|~+0#4040ff13&| @73
|
||||
| +0#0000000&@56|5@1|,|0|-|1| @7|B|o|t|
|
||||
@75
|
||||
@57|5@1|,|0|-|1| @7|7|1|%|
|
||||
|
||||
20
runtime/syntax/testdir/dumps/vim9_ex_for_04.dump
Normal file
20
runtime/syntax/testdir/dumps/vim9_ex_for_04.dump
Normal file
@ -0,0 +1,20 @@
|
||||
| +0&#ffffff0@74
|
||||
|#+0#0000e05&| |I|s@1|u|e| |#|7|9|6|1| |(|B|u|i|l|t|i|n| |t|y|p|e|s| |a|r|e| |n|o|t| |h|i|g|h|l|i|g|h|t|e|d| |i|n| |i|t|e|m|-|v|a|r|i|a|b|l|e| |d|e|c|l|a|r|a|t|i
|
||||
|o|n|s| +0#0000000&@71
|
||||
|#+0#0000e05&| @13|o|f| |:|f|o|r| |c|o|m@1|a|n|d|s|)| +0#0000000&@42
|
||||
@75
|
||||
>v+0#af5f00255&|a|r| +0#0000000&|m+0#00e0e07&|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@61
|
||||
|v+0#af5f00255&|a|r| +0#0000000&|n+0#00e0e07&|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&@61
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|x+0#00e0e07&|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|r+0#00e0e07&|a|n|g|e|(+0#e000e06&|2+0#e000002&|)+0#e000e06&| +0#0000000&||| |m+0#af5f00255&| +0#0000000&|=+0#af5f00255&| +0#0000000&|x+0#00e0e07&| +0#0000000&||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@32
|
||||
|#+0#0000e05&@5| |^@5| +0#0000000&@61
|
||||
|e+0#af5f00255&|c|h|o| +0#0000000&|m+0#00e0e07&| +0#0000000&@68
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|[|x+0#00e0e07&|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r|,+0#0000000&| |y+0#00e0e07&|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|[+0#e000e06&@1|0+0#e000002&|,+0#0000000&| |0+0#e000002&|]+0#e000e06&|,+0#0000000&| |[+0#e000e06&|1+0#e000002&|,+0#0000000&| |1+0#e000002&|]+0#e000e06&@1| +0#0000000&||| |[|m+0#00e0e07&|,+0#0000000&| |n+0#00e0e07&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|[+0#e000e06&|x+0#00e0e07&|,+0#0000000&| |y+0#00e0e07&|]+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@1
|
||||
|e+0#af5f00255&|c|h|o| +0#0000000&|m+0#00e0e07&| +0#0000000&|n+0#00e0e07&| +0#0000000&@66
|
||||
@75
|
||||
|v+0#af5f00255&|a|r| +0#0000000&|F+0#00e0e07&|:+0#0000000&| |f+0#00e0003&|u|n|c| +0#0000000&@63
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|t+0#00e0e07&|:+0#0000000&| |t+0#00e0003&|u|p|l|e|<|f|u|n|c|>| +0#0000000&|i+0#af5f00255&|n| +0#0000000&|(+0#e000e06&@1|f+0#00e0e07&|u|n|c|t|i|o|n|(+0#e000e06&|'+0#e000002&|t|o|l|o|w|e|r|'|)+0#e000e06&|,+0#0000000&|)+0#e000e06&|,+0#0000000&|)+0#e000e06&| +0#0000000&||| |F| |=+0#af5f00255&| +0#0000000&|t+0#00e0e07&|[+0#0000000&|0+0#e000002&|]+0#0000000&| ||| |e+0#af5f00255&|n|d|f|o|r| +0#0000000&@7
|
||||
|#+0#0000e05&@5| |^@10| +0#0000000&@56
|
||||
|e+0#af5f00255&|c|h|o| +0#0000000&|F|(+0#e000e06&|'+0#e000002&|H|E|L@1|O|'|)+0#e000e06&| +0#0000000&@59
|
||||
|f+0#af5f00255&|o|r| +0#0000000&|[|L+0#00e0e07&|:+0#0000000&| |f+0#00e0003&|u|n|c|,+0#0000000&| |U+0#00e0e07&|:+0#0000000&| |f+0#00e0003&|u|n|c|]+0#0000000&| |i+0#af5f00255&|n| +0#0000000&|[+0#e000e06&@1|f+0#00e0e07&|u|n|c|t|i|o|n|(+0#e000e06&|'+0#e000002&|t|o|l|o|w|e|r|'|)+0#e000e06&|,+0#0000000&| |f+0#00e0e07&|u|n|c|t|i|o|n|(+0#e000e06&|'+0#e000002&|t|o|u|p@1|e|r|'|)+0#e000e06&|]@1| +0#0000000&@4
|
||||
@4|[|_+0#00e0e07&|,+0#0000000&| |F+0#00e0e07&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|[+0#e000e06&|L+0#00e0e07&|,+0#0000000&| |U+0#00e0e07&|]+0#e000e06&| +0#0000000&@55
|
||||
@57|7|2|,|1| @9|9|5|%|
|
||||
20
runtime/syntax/testdir/dumps/vim9_ex_for_05.dump
Normal file
20
runtime/syntax/testdir/dumps/vim9_ex_for_05.dump
Normal file
@ -0,0 +1,20 @@
|
||||
| +0&#ffffff0@3|[|_+0#00e0e07&|,+0#0000000&| |F+0#00e0e07&|]+0#0000000&| |=+0#af5f00255&| +0#0000000&|[+0#e000e06&|L+0#00e0e07&|,+0#0000000&| |U+0#00e0e07&|]+0#e000e06&| +0#0000000&@55
|
||||
|e+0#af5f00255&|n|d|f|o|r| +0#0000000&@68
|
||||
|e+0#af5f00255&|c|h|o| +0#0000000&|F|(+0#e000e06&|'+0#e000002&|h|e|l@1|o|'|)+0#e000e06&| +0#0000000&|F|(+0#e000e06&|'+0#e000002&|w|o|r|l|d|'|)+0#e000e06&| +0#0000000&@48
|
||||
> @74
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|8@1|,|0|-|1| @7|B|o|t|
|
||||
@ -65,3 +65,24 @@ for [foo: number, bar: number] in expr2
|
||||
echo foo bar
|
||||
endfor
|
||||
|
||||
|
||||
# Issue #7961 (Builtin types are not highlighted in item-variable declarations
|
||||
# of :for commands)
|
||||
|
||||
var m: number
|
||||
var n: number
|
||||
for x: number in range(2) | m = x | endfor
|
||||
###### ^^^^^^
|
||||
echo m
|
||||
for [x: number, y: number] in [[0, 0], [1, 1]] | [m, n] = [x, y] | endfor
|
||||
echo m n
|
||||
|
||||
var F: func
|
||||
for t: tuple<func> in ((function('tolower'),),) | F = t[0] | endfor
|
||||
###### ^^^^^^^^^^^
|
||||
echo F('HELLO')
|
||||
for [L: func, U: func] in [[function('tolower'), function('toupper')]]
|
||||
[_, F] = [L, U]
|
||||
endfor
|
||||
echo F('hello') F('world')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user