File: vim_function_calls.vim

package info (click to toggle)
vim 2%3A9.1.2103-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 93,456 kB
  • sloc: ansic: 433,730; cpp: 6,399; makefile: 4,597; sh: 2,397; java: 2,312; xml: 2,099; python: 1,595; perl: 1,419; awk: 730; lisp: 501; cs: 458; objc: 369; sed: 8; csh: 6; haskell: 1
file content (277 lines) | stat: -rw-r--r-- 3,745 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
" Vim function calls
" VIM_TEST_SETUP hi link vimUserFunc Todo


call abs(42)


" Command/function distinction

" append browse call chdir confirm copy delete eval execute filter function
" insert join map match mode sort split substitute swapname type

let append = append(42)
call append(42)
" command
append
.
" bad command
append(42)
append (42)

let browse = browse(42)
call browse(42)
" command
browse(42)
browse (42)

let call = call(42)
call call(42)
" command
call(42)
call (42)

let chdir = chdir(42)
call chdir(42)
" command
chdir(42)
chdir (42)

let confirm = confirm(42)
call confirm(42)
" command
confirm(42)
confirm (42)

let copy = copy(42)
call copy(42)
" command
copy(42)
copy (42)

let delete = delete(42)
call delete(42)
" command
delete(42)
delete (42)

let eval = eval(42)
call eval(42)
" command
eval(42)
eval (42)

let execute = execute(42)
call execute(42)
" command
execute(42)
execute (42)

let filter = filter(42)
call filter(42)
" command
filter(42)
filter (42)

let function = function(42)
call function(42)
" command
function(42)
function (42)

let insert = insert(42)
call insert(42)
" command
insert
.
" bad command
insert(42)
insert (42)

let join = join(42)
call join(42)
" command
join(42)
join (42)

let map = map(42)
call map(42)
" command
map(42)
map (42)

let match = match(42)
call match(42)
" command
match(42)
match (42)

let sort = sort(42)
call sort(42)
" command
sort(42)
sort (42)

let split = split(42)
call split(42)
" command
split(42)
split (42)

let substitute = substitute(42)
call substitute(42)
" command
substitute(42)
substitute (42)

let swapname = swapname(42)
call swapname(42)
" command
swapname(42)
swapname (42)

let type = type(42)
call type(42)
" Vim9 command
" type(42)
" type (42)

let uniq = uniq(42)
call uniq(42)
" command
uniq(42)
uniq (42)


" Errors

let foo = foo(42)
call foo(42)

let if = if(42)
call if(42)
" command
if(42) | .. | endif
if (42) | .. | endif

let echo = echo(42)
call echo(42)
" command
echo(42)
echo (42)


" Expressions

let foo = abs(42)

echo abs(42)
echo (abs(42))
echo abs(42) + foo
echo foo + abs(42)

echo Foo()
echo (Foo())
echo Foo() + bar
echo bar + Foo()


" Scope modifiers and qualified names

let foo = s:foo(42)
call s:foo(42)

let foo = g:foo(42)
call g:foo(42)

let foo = b:foo(42)
call b:foo(42)

let foo = w:foo(42)
call w:foo(42)

let foo = t:foo(42)
call t:foo(42)

let foo = l:foo(42)
call l:foo(42)

let foo = a:foo(42)
call a:foo(42)

let foo = v:foo(42)
call v:foo(42)


let foo = module.foo(42)
call module.foo(42)

let foo = s:module.foo(42)
call module.foo(42)

let foo = g:module.foo(42)
call g:module.foo(42)

let foo = b:module.foo(42)
call b:module.foo(42)

let foo = w:module.foo(42)
call w:module.foo(42)

let foo = t:module.foo(42)
call t:module.foo(42)

let foo = l:module.foo(42)
call l:module.foo(42)

let foo = a:module.foo(42)
call a:module.foo(42)

let foo = v:module.foo(42)
call v:module.foo(42)


let foo = module#foo(42)
call module#foo(42)

let foo = g:module#foo(42)
call g:module#foo(42)


" Not builtin functions

call s:substitute()
call g:substitute()
call b:substitute()
call w:substitute()
call t:substitute()
call l:substitute()
call a:substitute()
call v:substitute()

call <SID>substitute()

call s:substitute.substitute()
call g:substitute.substitute()
call b:substitute.substitute()
call w:substitute.substitute()
call t:substitute.substitute()
call l:substitute.substitute()
call a:substitute.substitute()
call v:substitute.substitute()

call substitute#substitute()
call g:substitute#substitute()


" Chained function calls

call module.foo().bar()
call module.foo().substitute()


" Issue #17766 (valid function call highlighted as error)

call module[0].foo()
call module[0].substitute()