comparison src/evalfunc.c @ 19904:bd4f91762d0f v8.2.0508

patch 8.2.0508: Vim9: func and partial types not done yet Commit: https://github.com/vim/vim/commit/d77a8525d5438cae49f670eb473ef60d87ca5f54 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 3 21:59:57 2020 +0200 patch 8.2.0508: Vim9: func and partial types not done yet Problem: Vim9: func and partial types not done yet Solution: Fill in details about func declaration, drop a separate partial declaration.
author Bram Moolenaar <Bram@vim.org>
date Fri, 03 Apr 2020 22:15:03 +0200
parents 435726a03481
children 5e41b2e63c73
comparison
equal deleted inserted replaced
19903:dab021621df2 19904:bd4f91762d0f
332 } 332 }
333 static type_T * 333 static type_T *
334 ret_func_any(int argcount UNUSED, type_T **argtypes UNUSED) 334 ret_func_any(int argcount UNUSED, type_T **argtypes UNUSED)
335 { 335 {
336 return &t_func_any; 336 return &t_func_any;
337 }
338 static type_T *
339 ret_partial_any(int argcount UNUSED, type_T **argtypes UNUSED)
340 {
341 return &t_partial_any;
342 } 337 }
343 static type_T * 338 static type_T *
344 ret_channel(int argcount UNUSED, type_T **argtypes UNUSED) 339 ret_channel(int argcount UNUSED, type_T **argtypes UNUSED)
345 { 340 {
346 return &t_channel; 341 return &t_channel;
562 {"foldclosedend", 1, 1, FEARG_1, ret_number, f_foldclosedend}, 557 {"foldclosedend", 1, 1, FEARG_1, ret_number, f_foldclosedend},
563 {"foldlevel", 1, 1, FEARG_1, ret_number, f_foldlevel}, 558 {"foldlevel", 1, 1, FEARG_1, ret_number, f_foldlevel},
564 {"foldtext", 0, 0, 0, ret_string, f_foldtext}, 559 {"foldtext", 0, 0, 0, ret_string, f_foldtext},
565 {"foldtextresult", 1, 1, FEARG_1, ret_string, f_foldtextresult}, 560 {"foldtextresult", 1, 1, FEARG_1, ret_string, f_foldtextresult},
566 {"foreground", 0, 0, 0, ret_void, f_foreground}, 561 {"foreground", 0, 0, 0, ret_void, f_foreground},
567 {"funcref", 1, 3, FEARG_1, ret_partial_any, f_funcref}, 562 {"funcref", 1, 3, FEARG_1, ret_func_any, f_funcref},
568 {"function", 1, 3, FEARG_1, ret_f_function, f_function}, 563 {"function", 1, 3, FEARG_1, ret_f_function, f_function},
569 {"garbagecollect", 0, 1, 0, ret_void, f_garbagecollect}, 564 {"garbagecollect", 0, 1, 0, ret_void, f_garbagecollect},
570 {"get", 2, 3, FEARG_1, ret_any, f_get}, 565 {"get", 2, 3, FEARG_1, ret_any, f_get},
571 {"getbufinfo", 0, 1, 0, ret_list_dict_any, f_getbufinfo}, 566 {"getbufinfo", 0, 1, 0, ret_list_dict_any, f_getbufinfo},
572 {"getbufline", 2, 3, FEARG_1, ret_list_string, f_getbufline}, 567 {"getbufline", 2, 3, FEARG_1, ret_list_string, f_getbufline},
959 {"test_null_channel", 0, 0, 0, ret_channel, JOB_FUNC(f_test_null_channel)}, 954 {"test_null_channel", 0, 0, 0, ret_channel, JOB_FUNC(f_test_null_channel)},
960 {"test_null_dict", 0, 0, 0, ret_dict_any, f_test_null_dict}, 955 {"test_null_dict", 0, 0, 0, ret_dict_any, f_test_null_dict},
961 {"test_null_function", 0, 0, 0, ret_func_any, f_test_null_function}, 956 {"test_null_function", 0, 0, 0, ret_func_any, f_test_null_function},
962 {"test_null_job", 0, 0, 0, ret_job, JOB_FUNC(f_test_null_job)}, 957 {"test_null_job", 0, 0, 0, ret_job, JOB_FUNC(f_test_null_job)},
963 {"test_null_list", 0, 0, 0, ret_list_any, f_test_null_list}, 958 {"test_null_list", 0, 0, 0, ret_list_any, f_test_null_list},
964 {"test_null_partial", 0, 0, 0, ret_partial_any, f_test_null_partial}, 959 {"test_null_partial", 0, 0, 0, ret_func_any, f_test_null_partial},
965 {"test_null_string", 0, 0, 0, ret_string, f_test_null_string}, 960 {"test_null_string", 0, 0, 0, ret_string, f_test_null_string},
966 {"test_option_not_set", 1, 1, FEARG_1,ret_void, f_test_option_not_set}, 961 {"test_option_not_set", 1, 1, FEARG_1,ret_void, f_test_option_not_set},
967 {"test_override", 2, 2, FEARG_2, ret_void, f_test_override}, 962 {"test_override", 2, 2, FEARG_2, ret_void, f_test_override},
968 {"test_refcount", 1, 1, FEARG_1, ret_number, f_test_refcount}, 963 {"test_refcount", 1, 1, FEARG_1, ret_number, f_test_refcount},
969 {"test_scrollbar", 3, 3, FEARG_2, ret_void, 964 {"test_scrollbar", 3, 3, FEARG_2, ret_void,
2900 static type_T * 2895 static type_T *
2901 ret_f_function(int argcount, type_T **argtypes UNUSED) 2896 ret_f_function(int argcount, type_T **argtypes UNUSED)
2902 { 2897 {
2903 if (argcount == 1 && argtypes[0]->tt_type == VAR_STRING) 2898 if (argcount == 1 && argtypes[0]->tt_type == VAR_STRING)
2904 return &t_func_any; 2899 return &t_func_any;
2905 return &t_partial_void; 2900 return &t_func_void;
2906 } 2901 }
2907 2902
2908 /* 2903 /*
2909 * "function()" function 2904 * "function()" function
2910 */ 2905 */