Skip to content

Commit 175662f

Browse files
dkearnschrisbra
authored andcommitted
runtime(vim): Update base syntax, fix incorrect function error
Don't match lower-case function names as errors when the qualifier includes a dict/list accessor. This is a less than perfect fix until qualified function call matching is reworked. fixes: #17766 closes: #17780 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent f2290a6 commit 175662f

37 files changed

Lines changed: 242 additions & 234 deletions

runtime/syntax/generator/vim.vim.base

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ syn keyword vimBehaveModel contained mswin xterm
291291

292292
" Call {{{2
293293
" ====
294-
syn match vimCall "\<call\=\>" skipwhite nextgroup=@vimFunc
294+
syn match vimCall "\<call\=\>" skipwhite nextgroup=vimVar,@vimFunc
295295

296296
" Debuggreedy {{{2
297297
" ===========
@@ -2065,6 +2065,7 @@ unlet s:interfaces
20652065
" (following Gautam Iyer's suggestion)
20662066
" ==========================
20672067
syn match vimFunc contained "\<\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName
2068+
syn match vimUserFunc contained "\.\@1<=\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName
20682069
syn match vimUserFunc contained "\<\%([[:upper:]_]\|\%(\h\w*\.\)\+\h\)\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vim9MethodName,vim9Super,vim9This
20692070
syn match vimUserFunc contained "\<\%(g:\)\=\%(\h\w*#\)\+\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope
20702071
syn match vimUserFunc contained "\%(\<[sgbwtlav]:\|<[sS][iI][dD]>\)\%(\h\w*\.\)*\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation

runtime/syntax/testdir/dumps/vim9_function_call_00.dump

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
22
|#+0#0000e05&| |V|i|m| |f|u|n|c|t|i|o|n| |c|a|l@1|s| +0#0000000&@54
3-
|#+0#0000e05&| |V|I|M|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |v|i|m|U|s|e|r|F|u|n|c| |T|o|d|o| +0#0000000&@31
4-
|#+0#0000e05&| |V|I|M|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |v|i|m|9|U|s|e|r|F|u|n|c| |T|o|d|o| +0#0000000&@30
3+
|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |v|i|m|U|s|e|r|F|u|n|c| |T|o|d|o| +0#0000000&@26
4+
|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i|g|h|l|i|g|h|t| |l|i|n|k| |v|i|m|9|U|s|e|r|F|u|n|c| |T|o|d|o| +0#0000000&@25
55
@75
66
@75
77
|c+0#af5f00255&|a|l@1| +0#0000000&|a+0#00e0e07&|b|s|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@62

runtime/syntax/testdir/dumps/vim9_function_call_02.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|#+0#0000e05&| |c|o|m@1|a|n|d| +0#0000000&@65
1818
|c+0#af5f00255&|o|n|f|i|r|m| +0#0000000&|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@62
1919
@75
20-
@57|3|7|,|1| @9|1@1|%|
20+
@57|3|7|,|1| @9|1|0|%|

runtime/syntax/testdir/dumps/vim9_function_call_03.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|c+0#af5f00255&|a|l@1| +0#0000000&|e+0#00e0e07&|v|a|l|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@61
1818
|#+0#0000e05&| |f|u|n|c|t|i|o|n| +0#0000000&@64
1919
|e+0#00e0e07&|v|a|l|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@66
20-
@57|5@1|,|1| @9|1|7|%|
20+
@57|5@1|,|1| @9|1|6|%|

runtime/syntax/testdir/dumps/vim9_function_call_04.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|f+0#af5f00255&|i|l|t|e|r| +0#0000000&|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@63
1818
@75
1919
|v+0#af5f00255&|a|r| +0#0000000&|f|u|n|c|t|i|o|n| |=+0#af5f00255&| +0#0000000&|f+0#00e0e07&|u|n|c|t|i|o|n|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@47
20-
@57|7|3|,|1| @9|2|4|%|
20+
@57|7|3|,|1| @9|2@1|%|

runtime/syntax/testdir/dumps/vim9_function_call_05.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|#+0#0000e05&| |f|u|n|c|t|i|o|n| +0#0000000&@64
1818
|j+0#00e0e07&|o|i|n|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@66
1919
|#+0#0000e05&| |c|o|m@1|a|n|d| +0#0000000&@65
20-
@57|9|1|,|1| @9|3|0|%|
20+
@57|9|1|,|1| @9|2|8|%|

runtime/syntax/testdir/dumps/vim9_function_call_06.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
@75
1818
|v+0#af5f00255&|a|r| +0#0000000&|s|o|r|t| |=+0#af5f00255&| +0#0000000&|s+0#00e0e07&|o|r|t|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@55
1919
|c+0#af5f00255&|a|l@1| +0#0000000&|s+0#00e0e07&|o|r|t|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@61
20-
@57|1|0|9|,|1| @8|3|7|%|
20+
@57|1|0|9|,|1| @8|3|4|%|

runtime/syntax/testdir/dumps/vim9_function_call_07.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|s+0#00e0e07&|u|b|s|t|i|t|u|t|e|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@60
1818
|#+0#0000e05&| |c|o|m@1|a|n|d| +0#0000000&@65
1919
|s+0#af5f00255&|u|b|s|t|i|t|u|t|e| +0#0000000&|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@59
20-
@57|1|2|7|,|0|-|1| @6|4|3|%|
20+
@57|1|2|7|,|0|-|1| @6|4|0|%|

runtime/syntax/testdir/dumps/vim9_function_call_08.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|v+0#af5f00255&|a|r| +0#0000000&|u|n|i|q| |=+0#af5f00255&| +0#0000000&|u+0#00e0e07&|n|i|q|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@55
1818
|c+0#af5f00255&|a|l@1| +0#0000000&|u+0#00e0e07&|n|i|q|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&@61
1919
|#+0#0000e05&| |f|u|n|c|t|i|o|n| +0#0000000&@64
20-
@57|1|4|5|,|1| @8|5|0|%|
20+
@57|1|4|5|,|1| @8|4|6|%|

runtime/syntax/testdir/dumps/vim9_function_call_09.dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
|#+0#0000e05&| |c|o|m@1|a|n|d| +0#0000000&@65
1818
|i+0#af5f00255&|f| +0#0000000&|(+0#e000e06&|4+0#e000002&|2|)+0#e000e06&| +0#0000000&||| |.+0#af5f00255&@1| +0#0000000&||| |e+0#af5f00255&|n|d|i|f| +0#0000000&@54
1919
@75
20-
@57|1|6|3|,|0|-|1| @6|5|6|%|
20+
@57|1|6|3|,|0|-|1| @6|5|3|%|

0 commit comments

Comments
 (0)