Lines Matching refs:def

10   def SomeFunc(): string
24 def TestCompilingError()
27 def Fails()
43 def TestCompilingErrorInTry()
49 def script#OnlyCompiled()
77 def Test_compile_error_in_called_function()
81 def Foo()
84 def Bar()
93 def Test_wrong_function_name()
104 def _Foo()
111 def Test_autoload_name_mismatch()
117 def scriptX#Function()
135 def Test_autoload_names()
163 def Test_autoload_error_in_script()
209 def CallRecursive(n: number): number
213 def CallMapRecursive(l: list<number>): number
217 def Test_funcdepth_error()
239 def Test_endfunc_enddef()
241 def Test()
249 def Test()
258 def Ok()
261 def Bad()
268 def Test_missing_endfunc_enddef()
271 def Test()
286 def Test_white_space_before_paren()
289 def Test ()
304 def Test ()
318 def Test_enddef_dict_key()
326 def ReturnString(): string
330 def ReturnNumber(): number
336 def ReturnGlobal(): number
340 def Test_return_something()
346 def Test_check_argument_type()
349 def Val(a: number, b: number): number
352 def Func()
362 def Test_missing_return()
363 CheckDefFailure(['def Missing(): number',
370 CheckDefFailure(['def Missing(): number',
377 CheckDefFailure(['def Missing(): number',
387 def Test_return_bool()
390 def MenuFilter(id: number, key: string): bool
393 def YesnoFilter(id: number, key: string): bool
402 def ReturnNothing()
410 def Test_return_nothing()
415 def Test_return_invalid()
418 def Func(): invalid
427 def Test(Fun: func(number): number): list<number>
431 def Inc(nr: number): nr
441 def Test_return_list_any()
444 def Func(): list<string>
454 def Func(): list<string>
468 def Test_call_ufunc_count()
479 def MyVarargs(arg: string, ...rest: list<string>): string
487 def Test_call_varargs()
493 def Test_call_white_space()
497 def MyDefaultArgs(name = 'string'): string
501 def MyDefaultSecond(name: string, second: bool = true): string
506 def Test_call_default_args()
517 def MyDefaultThird(name: string, aa = 'aa', bb = 'bb'): string
529 def DefArg(mandatory: any, optional = mandatory): string
537 CheckScriptFailure(['def Func(arg: number = asdf)', 'enddef', 'defcompile'], 'E1001:')
539 …CheckScriptFailure(['def Func(arg: number = "text")', 'enddef', 'defcompile'], 'E1013: Argument 1:…
541 CheckDefFailure(['def Func(x: number = )', 'enddef'], 'E15:')
545 def Func(a = b == 0 ? 1 : 2, b = 0)
552 def FuncWithComment( # comment
561 def Test_func_with_comments()
565 def Func(# comment
572 def Func(
580 def Func(
588 def Test_nested_function()
589 def Nested(arg: string): string
594 CheckDefFailure(['def Nested()', 'enddef', 'Nested(66)'], 'E118:')
595 CheckDefFailure(['def Nested(arg: string)', 'enddef', 'Nested()'], 'E119:')
598 CheckDefFailure(['def s:Nested()', 'enddef'], 'E1075:')
599 CheckDefFailure(['def b:Nested()', 'enddef'], 'E1075:')
602 def Outer()
603 def Inner()
606 def Inner()
613 def Outer()
614 def Inner()
617 def! Inner()
628 def Test(): number
629 def TheFunc(): number
647 def Test(): number
648 def TheFunc(): number
663 def Outer()
664 def Inner()
673 def Test_not_nested_function()
684 def Test_nested_global_function()
687 def Outer()
688 def g:Inner(): string
707 def Outer()
708 def g:Inner(): string
721 def Outer()
722 def g:Inner()
734 def Func()
737 def Outer()
738 def Func()
748 def Func()
751 def Func()
758 def DefListAll()
759 def
762 def DefListOne()
763 def DefListOne
766 def DefListMatches()
767 def /DefList
770 def Test_nested_def_list()
773 assert_true(funcs->index('def DefListAll()') >= 0)
776 assert_equal([' def DefListOne()', '1 def DefListOne', ' enddef'], funcs)
780 assert_true(funcs->index('def DefListAll()') >= 0)
781 assert_true(funcs->index('def DefListOne()') >= 0)
782 assert_true(funcs->index('def DefListMatches()') >= 0)
786 def Func()
787 def +Func+
794 def Test_global_local_function()
797 def g:Func(): string
800 def Func(): string
811 def g:Funcy()
819 def Test_local_function_shadows_global()
822 def g:Gfunc(): string
825 def AnotherFunc(): number
837 def g:Func(): string
840 def AnotherFunc()
851 def g:Func(): string
854 def AnotherFunc(): string
864 def g:Func(): string
877 def Test_call_wrong_args()
881 CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:')
885 def Func(s: string)
895 def FuncOne(name: string)
903 def FuncOne(nr: number)
906 def FuncTwo()
924 def FuncOne(nr: number)
927 def FuncTwo()
946 def Test_call_funcref_wrong_args()
949 def Func3(a1: string, a2: number, a3: list<number>)
952 def Testme()
981 def Test_call_lambda_args()
1038 def ShadowLocal()
1047 def Shadowarg(one: number)
1066 def Test_lambda_line_nr()
1080 def FilterWithCond(x: string, Cond: func(string): bool): bool
1084 def Test_lambda_return_type()
1128 def Test_lambda_uses_assigned_var()
1134 def Test_pass_legacy_lambda_to_def_func()
1140 def Bar(y: any)
1148 def g:TestFunc(f: func)
1153 def g:TestFunc(f: func(number))
1161 def Test_lambda_in_reduce_line_break()
1182 def MyDefVarargs(one: string, two = 'foo', ...rest: list<string>): string
1190 def Test_call_def_varargs()
1202 def Func(...l: list<string>)
1211 def Func(...l: list<string>)
1220 def Func(...l: list<any>)
1229 def Func(...l: any)
1238 def Func(..._l: list<string>)
1247 def Func(...l: list<string>)
1256 def Func(...l: list<string>)
1265 def Func(...l: list<string>)
1274 def Func( # some comment
1284 def DoIt()
1288 def g:Later(...l: list<number>)
1297 def FuncOneDefArg(opt = 'text')
1301 def FuncTwoDefArg(nr = 123, opt = 'text'): string
1305 def FuncVarargs(...arg: list<string>): string
1309 def Test_func_type_varargs()
1337 def MyVarargsOnly(...args: list<string>): string
1341 def Test_call_varargs_only()
1349 def Test_using_var_as_arg()
1350 writefile(['def Func(x: number)', 'var x = 234', 'enddef', 'defcompile'], 'Xdef')
1355 def DictArg(arg: dict<string>)
1359 def ListArg(arg: list<string>)
1363 def Test_assign_to_argument()
1372 CheckScriptFailure(['def Func(arg: number)', 'arg = 3', 'enddef', 'defcompile'], 'E1090:')
1377 def WithReservedNames(firstline: string, lastline: string): string
1381 def Test_argument_names()
1385 def Test_call_func_defined_later()
1394 def Test_call_funcref()
1401 def RetNumber(): number
1411 def RetNumber(): number
1414 def Bar(F: func: number): number
1424 def UseNumber(nr: number)
1434 def UseNumber(nr: number)
1443 def EchoNr(nr = 34)
1456 def EchoList(...l: list<number>)
1469 def OptAndVar(nr: number, opt = 12, ...l: list<number>): number
1493 def CombineFuncrefTypes()
1513 def FuncWithForwardCall()
1517 def DefinedEvenLater(arg: string): string
1521 def Test_error_in_nested_function()
1526 def Test_return_type_wrong()
1528 'def Func(): number',
1534 'def Func(): string',
1540 'def Func(): void',
1547 'def Func()',
1555 'def Func(): number',
1562 'def Func():number',
1569 'def Func() :number',
1576 'def Func() : number',
1582 CheckScriptFailure(['def Func(): list', 'return []', 'enddef'], 'E1008:')
1584 CheckScriptFailure(['def Func(): dict', 'return {}', 'enddef'], 'E1008:')
1586 CheckScriptFailure(['def Func()', 'return 1'], 'E1057:')
1591 'def FuncB()',
1594 'def FuncA()',
1600 def Test_arg_type_wrong()
1601 CheckScriptFailure(['def Func3(items: list)', 'echo "a"', 'enddef'], 'E1008: Missing <type>')
1602 CheckScriptFailure(['def Func4(...)', 'echo "a"', 'enddef'], 'E1055: Missing name after ...')
1603 CheckScriptFailure(['def Func5(items:string)', 'echo "a"'], 'E1069:')
1604 CheckScriptFailure(['def Func5(items)', 'echo "a"'], 'E1077:')
1605 CheckScriptFailure(['def Func6(...x:list<number>)', 'echo "a"', 'enddef'], 'E1069:')
1606 CheckScriptFailure(['def Func7(...x: int)', 'echo "a"', 'enddef'], 'E1010:')
1609 def Test_white_space_before_comma()
1612 def Func(a: number , b: number)
1619 def Test_white_space_after_comma()
1622 def Func(a: number,b: number)
1636 def Test_vim9script_call()
1640 def MyFunc(arg: string)
1655 def ListFunc(arg: list<number>)
1662 def DictFunc(arg: dict<number>)
1667 def CompiledDict()
1688 def UseString()
1694 def UseString2()
1729 def Test_vim9script_call_fail_decl()
1733 def MyFunc(arg: string)
1741 def Test_vim9script_call_fail_type()
1744 def MyFunc(arg: string)
1752 def Test_vim9script_call_fail_const()
1756 def MyFunc(arg: string)
1767 def Change()
1777 " Test that inside :function a Python function can be defined, :def is not
1783 def do_something():
1788 def Test_delfunc()
1791 def g:GoneSoon()
1795 def CallGoneSoon()
1810 def Test_redef_failure()
1811 writefile(['def Func0(): string', 'return "Func0"', 'enddef'], 'Xdef')
1813 writefile(['def Func1(): string', 'return "Func1"', 'enddef'], 'Xdef')
1815 writefile(['def! Func0(): string', 'enddef', 'defcompile'], 'Xdef')
1817 writefile(['def Func2(): string', 'return "Func2"', 'enddef'], 'Xdef')
1830 def Test_vim9script_func()
1846 def FuncNoArgNoRet()
1850 def FuncNoArgRetNumber(): number
1855 def FuncNoArgRetString(): string
1860 def FuncOneArgNoRet(arg: number)
1864 def FuncOneArgRetNumber(arg: number): number
1869 def FuncTwoArgNoRet(one: bool, two: number)
1873 def FuncOneArgRetString(arg: string): string
1877 def FuncOneArgRetAny(arg: any): any
1881 def Test_func_type()
1910 def Test_repeat_return_type()
1924 def Test_argv_return_type()
1933 def Test_func_type_part()
1961 def Test_func_type_fails()
1977 def Test_func_return_type()
1992 def Test_func_common_type()
1993 def FuncOne(n: number): number
1996 def FuncTwo(s: string): number
1999 def FuncThree(n: number, s: string): number
2008 def MultiLine(
2016 def MultiLineComment(
2024 def Test_multiline()
2044 def F():
2054 def F5(items : list)
2067 def Test_error_reporting()
2071 def Func()
2091 def Func()
2111 def Func()
2131 def Test_deleted_function()
2138 def Test_unknown_function()
2144 def RefFunc(Ref: func(any): any): string
2148 def Test_closure_simple()
2153 def MakeRef()
2158 def Test_closure_ref_after_return()
2164 def MakeTwoRefs()
2170 def Test_closure_two_refs()
2182 def ReadRef(Ref: func(): list<string>): string
2186 def ExtendRef(Ref: func(string): list<string>, add: string)
2190 def Test_closure_two_indirect_refs()
2202 def MakeArgRefs(theArg: string)
2207 def MakeArgRefsVarargs(theArg: string, ...rest: list<string>)
2212 def Test_closure_using_argument()
2224 def Test(Fun: func(number): number): list<number>
2227 def Inc(nr: number): number
2235 def MakeGetAndAppendRefs()
2238 def Append(arg: string)
2243 def Get(): string
2249 def Test_closure_append_get()
2261 def Test_nested_closure()
2263 def Closure(arg: string): string
2273 def Test_call_closure_not_compiled()
2279 def Test_double_closure_fails()
2282 def Func()
2293 def Test_nested_closure_used()
2296 def Func()
2307 def Test_nested_closure_fails()
2310 def FuncA()
2313 def FuncB(n: number): list<string>
2321 def Test_global_closure()
2324 def ReverseEveryNLines(n: number, line1: number, line2: number)
2327 def g:Offset(): number
2344 def Test_global_closure_called_directly()
2347 def Outer()
2349 def g:Inner()
2363 def Test_failure_in_called_function()
2368 def PopupTerm(a: any)
2373 def FireEvent()
2386 def Test_nested_lambda()
2389 def Func()
2401 def Test_double_nested_lambda()
2404 def F(head: string): func(string): func(string): string
2414 def Test_nested_inline_lambda()
2417 def F(text: string): func(string): func(string): string
2439 def s:func()
2453 def Shadowed(): list<number>
2458 def Test_lambda_arg_shadows_func()
2462 def Line_continuation_in_def(dir: string = ''): string
2469 def Test_line_continuation_in_def()
2473 def Test_script_var_in_lambda()
2482 def Line_continuation_in_lambda(): list<string>
2490 def Test_line_continuation_in_lambda()
2506 def Test_list_lambda()
2513 assert_match('def <lambda>\d\+(_: any): number\n1 return 0\n enddef', body)
2516 def Test_lambda_block_variable()
2561 def Test_legacy_lambda()
2571 def Func()
2579 def Test_legacy()
2585 def Testit()
2596 def Test_legacy_errors()
2605 def Test_call_legacy_with_dict()
2611 def TestDirect()
2619 def TestIndirect()
2636 def DoFilterThis(a: string): list<string>
2642 def Test_nested_closure_using_argument()
2646 def Test_triple_nested_closure()
2658 def EchoNothing()
2675 def SilentlyError()
2684 def SilentlyUserError()
2689 " This can't be a :def function, because the assert would not be reached.
2702 def Test_ignore_silent_error_in_filter()
2705 def Filter(winid: number, key: string): bool
2719 def Fibonacci(n: number): number
2727 def Test_recursive_call()
2731 def TreeWalk(dir: string): list<any>
2739 def Test_closure_in_map()
2750 def Test_invalid_function_name()
2753 def s: list<string>
2759 def g: list<string>
2765 def <SID>: list<string>
2771 def F list<string>
2776 def Test_partial_call()
2805 def Foo(Parser: any)
2813 def Test_cmd_modifier()
2818 def Test_restore_modifiers()
2819 # check that when compiling a :def function command modifiers are not messed
2825 def AutocmdsDisabled()
2838 def StackTop()
2845 def StackBot()
2850 def Test_callstack_def()
2859 def Test_block_scoped_var()
2862 def Func()
2876 def Test_reset_did_emsg()
2880 def Func()
2891 def Test_did_emsg_reset()
2897 def Func()
2911 def Test_abort_with_silent_call()
2915 def Func()
2927 def Test_continues_with_silent_error()
2931 def Func()
2943 def Test_abort_even_with_silent()
2947 def Func()
2958 def Test_cmdmod_silent_restored()
2961 def Func()
2983 def Test_cmdmod_silent_nested()
2988 def Error()
2994 def Crash()
3006 def Test_dict_member_with_silent()
3011 def Func()
3024 def Test_skip_cmds_with_silent()
3028 def Func(b: bool)
3032 def Crash()
3042 def Test_opfunc()
3044 def g:Opfunc(_: any): string
3058 def Test_nested_lambda_in_closure()
3062 def Outer()
3063 def g:Inner()
3078 def Test_check_func_arg_types()
3081 def F1(x: string): string
3085 def F2(x: number): number
3089 def G(g: func): dict<func>
3093 def H(d: dict<func>): string
3102 def Test_list_any_type_checked()
3105 def Foo()
3109 def Bar(ll: list<dict<any>>)
3123 def Test_compile_error()
3125 def g:Broken()
3139 def g:Broken()
3151 def Test_ignored_argument()
3154 def Ignore(_, _): string
3175 def Ignore(_: string): string
3193 def Test_too_many_arguments()
3205 def Test_closing_brace_at_start_of_line()
3207 def Func()
3222 def Test_numbered_function_reference()
3233 def Test_python3_heredoc()
3250 def Test_lua_heredoc()