Patch 8.2.2369
Problem: Vim9: functions return true/false but can't be used as bool.
Solution: Add ret_number_bool(). (closes #7693)
Files: src/evalfunc.c, src/testdir/test_vim9_builtin.vim,
src/testdir/test_vim9_disassemble.vim
*** ../vim-8.2.2368/src/evalfunc.c 2021-01-17 13:21:14.962687183 +0100
--- src/evalfunc.c 2021-01-17 16:06:11.807521995 +0100
***************
*** 449,454 ****
--- 449,459 ----
return &t_bool;
}
static type_T *
+ ret_number_bool(int argcount UNUSED, type_T **argtypes UNUSED)
+ {
+ return &t_number_bool;
+ }
+ static type_T *
ret_number(int argcount UNUSED, type_T **argtypes UNUSED)
{
return &t_number;
***************
*** 690,698 ****
{"and", 2, 2, FEARG_1, NULL,
ret_number, f_and},
{"append", 2, 2, FEARG_2, NULL,
! ret_number, f_append},
{"appendbufline", 3, 3, FEARG_3, NULL,
! ret_number, f_appendbufline},
{"argc", 0, 1, 0, NULL,
ret_number, f_argc},
{"argidx", 0, 0, 0, NULL,
--- 695,703 ----
{"and", 2, 2, FEARG_1, NULL,
ret_number, f_and},
{"append", 2, 2, FEARG_2, NULL,
! ret_number_bool, f_append},
{"appendbufline", 3, 3, FEARG_3, NULL,
! ret_number_bool, f_appendbufline},
{"argc", 0, 1, 0, NULL,
ret_number, f_argc},
{"argidx", 0, 0, 0, NULL,
***************
*** 704,732 ****
{"asin", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_asin)},
{"assert_beeps", 1, 2, FEARG_1, NULL,
! ret_number, f_assert_beeps},
{"assert_equal", 2, 3, FEARG_2, NULL,
! ret_number, f_assert_equal},
{"assert_equalfile", 2, 3, FEARG_1, NULL,
! ret_number, f_assert_equalfile},
{"assert_exception", 1, 2, 0, NULL,
! ret_number, f_assert_exception},
{"assert_fails", 1, 5, FEARG_1, NULL,
! ret_number, f_assert_fails},
{"assert_false", 1, 2, FEARG_1, NULL,
! ret_number, f_assert_false},
{"assert_inrange", 3, 4, FEARG_3, NULL,
! ret_number, f_assert_inrange},
{"assert_match", 2, 3, FEARG_2, NULL,
! ret_number, f_assert_match},
{"assert_notequal", 2, 3, FEARG_2, NULL,
! ret_number, f_assert_notequal},
{"assert_notmatch", 2, 3, FEARG_2, NULL,
! ret_number, f_assert_notmatch},
{"assert_report", 1, 1, FEARG_1, NULL,
! ret_number, f_assert_report},
{"assert_true", 1, 2, FEARG_1, NULL,
! ret_number, f_assert_true},
{"atan", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_atan)},
{"atan2", 2, 2, FEARG_1, NULL,
--- 709,737 ----
{"asin", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_asin)},
{"assert_beeps", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_assert_beeps},
{"assert_equal", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_assert_equal},
{"assert_equalfile", 2, 3, FEARG_1, NULL,
! ret_number_bool, f_assert_equalfile},
{"assert_exception", 1, 2, 0, NULL,
! ret_number_bool, f_assert_exception},
{"assert_fails", 1, 5, FEARG_1, NULL,
! ret_number_bool, f_assert_fails},
{"assert_false", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_assert_false},
{"assert_inrange", 3, 4, FEARG_3, NULL,
! ret_number_bool, f_assert_inrange},
{"assert_match", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_assert_match},
{"assert_notequal", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_assert_notequal},
{"assert_notmatch", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_assert_notmatch},
{"assert_report", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_assert_report},
{"assert_true", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_assert_true},
{"atan", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_atan)},
{"atan2", 2, 2, FEARG_1, NULL,
***************
*** 762,780 ****
{"bufadd", 1, 1, FEARG_1, NULL,
ret_number, f_bufadd},
{"bufexists", 1, 1, FEARG_1, NULL,
! ret_number, f_bufexists},
{"buffer_exists", 1, 1, FEARG_1, NULL, // obsolete
! ret_number, f_bufexists},
{"buffer_name", 0, 1, FEARG_1, NULL, // obsolete
ret_string, f_bufname},
{"buffer_number", 0, 1, FEARG_1, NULL, // obsolete
ret_number, f_bufnr},
{"buflisted", 1, 1, FEARG_1, NULL,
! ret_number, f_buflisted},
{"bufload", 1, 1, FEARG_1, NULL,
ret_void, f_bufload},
{"bufloaded", 1, 1, FEARG_1, NULL,
! ret_number, f_bufloaded},
{"bufname", 0, 1, FEARG_1, NULL,
ret_string, f_bufname},
{"bufnr", 0, 2, FEARG_1, NULL,
--- 767,785 ----
{"bufadd", 1, 1, FEARG_1, NULL,
ret_number, f_bufadd},
{"bufexists", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_bufexists},
{"buffer_exists", 1, 1, FEARG_1, NULL, // obsolete
! ret_number_bool, f_bufexists},
{"buffer_name", 0, 1, FEARG_1, NULL, // obsolete
ret_string, f_bufname},
{"buffer_number", 0, 1, FEARG_1, NULL, // obsolete
ret_number, f_bufnr},
{"buflisted", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_buflisted},
{"bufload", 1, 1, FEARG_1, NULL,
ret_void, f_bufload},
{"bufloaded", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_bufloaded},
{"bufname", 0, 1, FEARG_1, NULL,
ret_string, f_bufname},
{"bufnr", 0, 2, FEARG_1, NULL,
***************
*** 794,800 ****
{"ceil", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_ceil)},
{"ch_canread", 1, 1, FEARG_1, NULL,
! ret_number, JOB_FUNC(f_ch_canread)},
{"ch_close", 1, 1, FEARG_1, NULL,
ret_void, JOB_FUNC(f_ch_close)},
{"ch_close_in", 1, 1, FEARG_1, NULL,
--- 799,805 ----
{"ceil", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_ceil)},
{"ch_canread", 1, 1, FEARG_1, NULL,
! ret_number_bool, JOB_FUNC(f_ch_canread)},
{"ch_close", 1, 1, FEARG_1, NULL,
ret_void, JOB_FUNC(f_ch_close)},
{"ch_close_in", 1, 1, FEARG_1, NULL,
***************
*** 852,858 ****
{"complete_add", 1, 1, FEARG_1, NULL,
ret_number, f_complete_add},
{"complete_check", 0, 0, 0, NULL,
! ret_number, f_complete_check},
{"complete_info", 0, 1, FEARG_1, NULL,
ret_dict_any, f_complete_info},
{"confirm", 1, 4, FEARG_1, NULL,
--- 857,863 ----
{"complete_add", 1, 1, FEARG_1, NULL,
ret_number, f_complete_add},
{"complete_check", 0, 0, 0, NULL,
! ret_number_bool, f_complete_check},
{"complete_info", 0, 1, FEARG_1, NULL,
ret_dict_any, f_complete_info},
{"confirm", 1, 4, FEARG_1, NULL,
***************
*** 880,898 ****
{"deepcopy", 1, 2, FEARG_1, NULL,
ret_first_arg, f_deepcopy},
{"delete", 1, 2, FEARG_1, NULL,
! ret_number, f_delete},
{"deletebufline", 2, 3, FEARG_1, NULL,
! ret_number, f_deletebufline},
{"did_filetype", 0, 0, 0, NULL,
! ret_number, f_did_filetype},
{"diff_filler", 1, 1, FEARG_1, NULL,
ret_number, f_diff_filler},
{"diff_hlID", 2, 2, FEARG_1, NULL,
ret_number, f_diff_hlID},
{"echoraw", 1, 1, FEARG_1, NULL,
! ret_number, f_echoraw},
{"empty", 1, 1, FEARG_1, NULL,
! ret_number, f_empty},
{"environ", 0, 0, 0, NULL,
ret_dict_string, f_environ},
{"escape", 2, 2, FEARG_1, NULL,
--- 885,903 ----
{"deepcopy", 1, 2, FEARG_1, NULL,
ret_first_arg, f_deepcopy},
{"delete", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_delete},
{"deletebufline", 2, 3, FEARG_1, NULL,
! ret_number_bool, f_deletebufline},
{"did_filetype", 0, 0, 0, NULL,
! ret_number_bool, f_did_filetype},
{"diff_filler", 1, 1, FEARG_1, NULL,
ret_number, f_diff_filler},
{"diff_hlID", 2, 2, FEARG_1, NULL,
ret_number, f_diff_hlID},
{"echoraw", 1, 1, FEARG_1, NULL,
! ret_void, f_echoraw},
{"empty", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_empty},
{"environ", 0, 0, 0, NULL,
ret_dict_string, f_environ},
{"escape", 2, 2, FEARG_1, NULL,
***************
*** 900,906 ****
{"eval", 1, 1, FEARG_1, NULL,
ret_any, f_eval},
{"eventhandler", 0, 0, 0, NULL,
! ret_number, f_eventhandler},
{"executable", 1, 1, FEARG_1, NULL,
ret_number, f_executable},
{"execute", 1, 2, FEARG_1, NULL,
--- 905,911 ----
{"eval", 1, 1, FEARG_1, NULL,
ret_any, f_eval},
{"eventhandler", 0, 0, 0, NULL,
! ret_number_bool, f_eventhandler},
{"executable", 1, 1, FEARG_1, NULL,
ret_number, f_executable},
{"execute", 1, 2, FEARG_1, NULL,
***************
*** 908,914 ****
{"exepath", 1, 1, FEARG_1, NULL,
ret_string, f_exepath},
{"exists", 1, 1, FEARG_1, NULL,
! ret_number, f_exists},
{"exp", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_exp)},
{"expand", 1, 3, FEARG_1, NULL,
--- 913,919 ----
{"exepath", 1, 1, FEARG_1, NULL,
ret_string, f_exepath},
{"exists", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_exists},
{"exp", 1, 1, FEARG_1, NULL,
ret_float, FLOAT_FUNC(f_exp)},
{"expand", 1, 3, FEARG_1, NULL,
***************
*** 922,930 ****
{"feedkeys", 1, 2, FEARG_1, NULL,
ret_void, f_feedkeys},
{"file_readable", 1, 1, FEARG_1, NULL, // obsolete
! ret_number, f_filereadable},
{"filereadable", 1, 1, FEARG_1, NULL,
! ret_number, f_filereadable},
{"filewritable", 1, 1, FEARG_1, NULL,
ret_number, f_filewritable},
{"filter", 2, 2, FEARG_1, NULL,
--- 927,935 ----
{"feedkeys", 1, 2, FEARG_1, NULL,
ret_void, f_feedkeys},
{"file_readable", 1, 1, FEARG_1, NULL, // obsolete
! ret_number_bool, f_filereadable},
{"filereadable", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_filereadable},
{"filewritable", 1, 1, FEARG_1, NULL,
ret_number, f_filewritable},
{"filter", 2, 2, FEARG_1, NULL,
***************
*** 1010,1016 ****
{"getftype", 1, 1, FEARG_1, NULL,
ret_string, f_getftype},
{"getimstatus", 0, 0, 0, NULL,
! ret_number, f_getimstatus},
{"getjumplist", 0, 2, FEARG_1, NULL,
ret_list_any, f_getjumplist},
{"getline", 1, 2, FEARG_1, NULL,
--- 1015,1021 ----
{"getftype", 1, 1, FEARG_1, NULL,
ret_string, f_getftype},
{"getimstatus", 0, 0, 0, NULL,
! ret_number_bool, f_getimstatus},
{"getjumplist", 0, 2, FEARG_1, NULL,
ret_list_any, f_getjumplist},
{"getline", 1, 2, FEARG_1, NULL,
***************
*** 1062,1082 ****
{"globpath", 2, 5, FEARG_2, NULL,
ret_any, f_globpath},
{"has", 1, 2, 0, NULL,
! ret_number, f_has},
{"has_key", 2, 2, FEARG_1, NULL,
! ret_number, f_has_key},
{"haslocaldir", 0, 2, FEARG_1, NULL,
ret_number, f_haslocaldir},
{"hasmapto", 1, 3, FEARG_1, NULL,
! ret_number, f_hasmapto},
{"highlightID", 1, 1, FEARG_1, NULL, // obsolete
ret_number, f_hlID},
{"highlight_exists",1, 1, FEARG_1, NULL, // obsolete
! ret_number, f_hlexists},
{"histadd", 2, 2, FEARG_2, NULL,
! ret_number, f_histadd},
{"histdel", 1, 2, FEARG_1, NULL,
! ret_number, f_histdel},
{"histget", 1, 2, FEARG_1, NULL,
ret_string, f_histget},
{"histnr", 1, 1, FEARG_1, NULL,
--- 1067,1087 ----
{"globpath", 2, 5, FEARG_2, NULL,
ret_any, f_globpath},
{"has", 1, 2, 0, NULL,
! ret_number_bool, f_has},
{"has_key", 2, 2, FEARG_1, NULL,
! ret_number_bool, f_has_key},
{"haslocaldir", 0, 2, FEARG_1, NULL,
ret_number, f_haslocaldir},
{"hasmapto", 1, 3, FEARG_1, NULL,
! ret_number_bool, f_hasmapto},
{"highlightID", 1, 1, FEARG_1, NULL, // obsolete
ret_number, f_hlID},
{"highlight_exists",1, 1, FEARG_1, NULL, // obsolete
! ret_number_bool, f_hlexists},
{"histadd", 2, 2, FEARG_2, NULL,
! ret_number_bool, f_histadd},
{"histdel", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_histdel},
{"histget", 1, 2, FEARG_1, NULL,
ret_string, f_histget},
{"histnr", 1, 1, FEARG_1, NULL,
***************
*** 1084,1090 ****
{"hlID", 1, 1, FEARG_1, NULL,
ret_number, f_hlID},
{"hlexists", 1, 1, FEARG_1, NULL,
! ret_number, f_hlexists},
{"hostname", 0, 0, 0, NULL,
ret_string, f_hostname},
{"iconv", 3, 3, FEARG_1, NULL,
--- 1089,1095 ----
{"hlID", 1, 1, FEARG_1, NULL,
ret_number, f_hlID},
{"hlexists", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_hlexists},
{"hostname", 0, 0, 0, NULL,
ret_string, f_hostname},
{"iconv", 3, 3, FEARG_1, NULL,
***************
*** 1100,1108 ****
{"inputlist", 1, 1, FEARG_1, NULL,
ret_number, f_inputlist},
{"inputrestore", 0, 0, 0, NULL,
! ret_number, f_inputrestore},
{"inputsave", 0, 0, 0, NULL,
! ret_number, f_inputsave},
{"inputsecret", 1, 2, FEARG_1, NULL,
ret_string, f_inputsecret},
{"insert", 2, 3, FEARG_1, arg3_insert,
--- 1105,1113 ----
{"inputlist", 1, 1, FEARG_1, NULL,
ret_number, f_inputlist},
{"inputrestore", 0, 0, 0, NULL,
! ret_number_bool, f_inputrestore},
{"inputsave", 0, 0, 0, NULL,
! ret_number_bool, f_inputsave},
{"inputsecret", 1, 2, FEARG_1, NULL,
ret_string, f_inputsecret},
{"insert", 2, 3, FEARG_1, arg3_insert,
***************
*** 1112,1124 ****
{"invert", 1, 1, FEARG_1, NULL,
ret_number, f_invert},
{"isdirectory", 1, 1, FEARG_1, NULL,
! ret_number, f_isdirectory},
{"isinf", 1, 1, FEARG_1, NULL,
ret_number, MATH_FUNC(f_isinf)},
{"islocked", 1, 1, FEARG_1, NULL,
! ret_number, f_islocked},
{"isnan", 1, 1, FEARG_1, NULL,
! ret_number, MATH_FUNC(f_isnan)},
{"items", 1, 1, FEARG_1, NULL,
ret_list_any, f_items},
{"job_getchannel", 1, 1, FEARG_1, NULL,
--- 1117,1129 ----
{"invert", 1, 1, FEARG_1, NULL,
ret_number, f_invert},
{"isdirectory", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_isdirectory},
{"isinf", 1, 1, FEARG_1, NULL,
ret_number, MATH_FUNC(f_isinf)},
{"islocked", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_islocked},
{"isnan", 1, 1, FEARG_1, NULL,
! ret_number_bool, MATH_FUNC(f_isnan)},
{"items", 1, 1, FEARG_1, NULL,
ret_list_any, f_items},
{"job_getchannel", 1, 1, FEARG_1, NULL,
***************
*** 1132,1138 ****
{"job_status", 1, 1, FEARG_1, NULL,
ret_string, JOB_FUNC(f_job_status)},
{"job_stop", 1, 2, FEARG_1, NULL,
! ret_number, JOB_FUNC(f_job_stop)},
{"join", 1, 2, FEARG_1, NULL,
ret_string, f_join},
{"js_decode", 1, 1, FEARG_1, NULL,
--- 1137,1143 ----
{"job_status", 1, 1, FEARG_1, NULL,
ret_string, JOB_FUNC(f_job_status)},
{"job_stop", 1, 2, FEARG_1, NULL,
! ret_number_bool, JOB_FUNC(f_job_stop)},
{"join", 1, 2, FEARG_1, NULL,
ret_string, f_join},
{"js_decode", 1, 1, FEARG_1, NULL,
***************
*** 1166,1172 ****
{"listener_flush", 0, 1, FEARG_1, NULL,
ret_void, f_listener_flush},
{"listener_remove", 1, 1, FEARG_1, NULL,
! ret_number, f_listener_remove},
{"localtime", 0, 0, 0, NULL,
ret_number, f_localtime},
{"log", 1, 1, FEARG_1, NULL,
--- 1171,1177 ----
{"listener_flush", 0, 1, FEARG_1, NULL,
ret_void, f_listener_flush},
{"listener_remove", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_listener_remove},
{"localtime", 0, 0, 0, NULL,
ret_number, f_localtime},
{"log", 1, 1, FEARG_1, NULL,
***************
*** 1200,1206 ****
{"matcharg", 1, 1, FEARG_1, NULL,
ret_list_string, f_matcharg},
{"matchdelete", 1, 2, FEARG_1, NULL,
! ret_number, f_matchdelete},
{"matchend", 2, 4, FEARG_1, NULL,
ret_number, f_matchend},
{"matchfuzzy", 2, 3, FEARG_1, NULL,
--- 1205,1211 ----
{"matcharg", 1, 1, FEARG_1, NULL,
ret_list_string, f_matcharg},
{"matchdelete", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_matchdelete},
{"matchend", 2, 4, FEARG_1, NULL,
ret_number, f_matchend},
{"matchfuzzy", 2, 3, FEARG_1, NULL,
***************
*** 1226,1232 ****
{"min", 1, 1, FEARG_1, NULL,
ret_any, f_min},
{"mkdir", 1, 3, FEARG_1, NULL,
! ret_number, f_mkdir},
{"mode", 0, 1, FEARG_1, NULL,
ret_string, f_mode},
{"mzeval", 1, 1, FEARG_1, NULL,
--- 1231,1237 ----
{"min", 1, 1, FEARG_1, NULL,
ret_any, f_min},
{"mkdir", 1, 3, FEARG_1, NULL,
! ret_number_bool, f_mkdir},
{"mode", 0, 1, FEARG_1, NULL,
ret_string, f_mode},
{"mzeval", 1, 1, FEARG_1, NULL,
***************
*** 1332,1338 ****
{"pum_getpos", 0, 0, 0, NULL,
ret_dict_number, f_pum_getpos},
{"pumvisible", 0, 0, 0, NULL,
! ret_number, f_pumvisible},
{"py3eval", 1, 1, FEARG_1, NULL,
ret_any,
#ifdef FEAT_PYTHON3
--- 1337,1343 ----
{"pum_getpos", 0, 0, 0, NULL,
ret_dict_number, f_pum_getpos},
{"pumvisible", 0, 0, 0, NULL,
! ret_number_bool, f_pumvisible},
{"py3eval", 1, 1, FEARG_1, NULL,
ret_any,
#ifdef FEAT_PYTHON3
***************
*** 1396,1402 ****
{"remove", 2, 3, FEARG_1, NULL,
ret_remove, f_remove},
{"rename", 2, 2, FEARG_1, NULL,
! ret_number, f_rename},
{"repeat", 2, 2, FEARG_1, NULL,
ret_first_arg, f_repeat},
{"resolve", 1, 1, FEARG_1, NULL,
--- 1401,1407 ----
{"remove", 2, 3, FEARG_1, NULL,
ret_remove, f_remove},
{"rename", 2, 2, FEARG_1, NULL,
! ret_number_bool, f_rename},
{"repeat", 2, 2, FEARG_1, NULL,
ret_first_arg, f_repeat},
{"resolve", 1, 1, FEARG_1, NULL,
***************
*** 1432,1438 ****
{"searchcount", 0, 1, FEARG_1, NULL,
ret_dict_any, f_searchcount},
{"searchdecl", 1, 3, FEARG_1, NULL,
! ret_number, f_searchdecl},
{"searchpair", 3, 7, 0, NULL,
ret_number, f_searchpair},
{"searchpairpos", 3, 7, 0, NULL,
--- 1437,1443 ----
{"searchcount", 0, 1, FEARG_1, NULL,
ret_dict_any, f_searchcount},
{"searchdecl", 1, 3, FEARG_1, NULL,
! ret_number_bool, f_searchdecl},
{"searchpair", 3, 7, 0, NULL,
ret_number, f_searchpair},
{"searchpairpos", 3, 7, 0, NULL,
***************
*** 1440,1484 ****
{"searchpos", 1, 5, FEARG_1, NULL,
ret_list_number, f_searchpos},
{"server2client", 2, 2, FEARG_1, NULL,
! ret_number, f_server2client},
{"serverlist", 0, 0, 0, NULL,
ret_string, f_serverlist},
{"setbufline", 3, 3, FEARG_3, NULL,
! ret_number, f_setbufline},
{"setbufvar", 3, 3, FEARG_3, NULL,
ret_void, f_setbufvar},
{"setcellwidths", 1, 1, FEARG_1, NULL,
ret_void, f_setcellwidths},
{"setcharpos", 2, 2, FEARG_2, NULL,
! ret_number, f_setcharpos},
{"setcharsearch", 1, 1, FEARG_1, NULL,
ret_void, f_setcharsearch},
{"setcmdpos", 1, 1, FEARG_1, NULL,
! ret_number, f_setcmdpos},
! {"setcursorcharpos", 1, 3, FEARG_1, NULL,
! ret_number, f_setcursorcharpos},
{"setenv", 2, 2, FEARG_2, NULL,
ret_void, f_setenv},
{"setfperm", 2, 2, FEARG_1, NULL,
! ret_number, f_setfperm},
{"setline", 2, 2, FEARG_2, NULL,
! ret_number, f_setline},
{"setloclist", 2, 4, FEARG_2, NULL,
! ret_number, f_setloclist},
{"setmatches", 1, 2, FEARG_1, NULL,
! ret_number, f_setmatches},
{"setpos", 2, 2, FEARG_2, NULL,
! ret_number, f_setpos},
{"setqflist", 1, 3, FEARG_1, NULL,
! ret_number, f_setqflist},
{"setreg", 2, 3, FEARG_2, NULL,
! ret_number, f_setreg},
{"settabvar", 3, 3, FEARG_3, NULL,
ret_void, f_settabvar},
{"settabwinvar", 4, 4, FEARG_4, NULL,
ret_void, f_settabwinvar},
{"settagstack", 2, 3, FEARG_2, NULL,
! ret_number, f_settagstack},
{"setwinvar", 3, 3, FEARG_3, NULL,
ret_void, f_setwinvar},
{"sha256", 1, 1, FEARG_1, NULL,
--- 1445,1489 ----
{"searchpos", 1, 5, FEARG_1, NULL,
ret_list_number, f_searchpos},
{"server2client", 2, 2, FEARG_1, NULL,
! ret_number_bool, f_server2client},
{"serverlist", 0, 0, 0, NULL,
ret_string, f_serverlist},
{"setbufline", 3, 3, FEARG_3, NULL,
! ret_number_bool, f_setbufline},
{"setbufvar", 3, 3, FEARG_3, NULL,
ret_void, f_setbufvar},
{"setcellwidths", 1, 1, FEARG_1, NULL,
ret_void, f_setcellwidths},
{"setcharpos", 2, 2, FEARG_2, NULL,
! ret_number_bool, f_setcharpos},
{"setcharsearch", 1, 1, FEARG_1, NULL,
ret_void, f_setcharsearch},
{"setcmdpos", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_setcmdpos},
! {"setcursorcharpos", 1, 3, FEARG_1, NULL,
! ret_number_bool, f_setcursorcharpos},
{"setenv", 2, 2, FEARG_2, NULL,
ret_void, f_setenv},
{"setfperm", 2, 2, FEARG_1, NULL,
! ret_number_bool, f_setfperm},
{"setline", 2, 2, FEARG_2, NULL,
! ret_number_bool, f_setline},
{"setloclist", 2, 4, FEARG_2, NULL,
! ret_number_bool, f_setloclist},
{"setmatches", 1, 2, FEARG_1, NULL,
! ret_number_bool, f_setmatches},
{"setpos", 2, 2, FEARG_2, NULL,
! ret_number_bool, f_setpos},
{"setqflist", 1, 3, FEARG_1, NULL,
! ret_number_bool, f_setqflist},
{"setreg", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_setreg},
{"settabvar", 3, 3, FEARG_3, NULL,
ret_void, f_settabvar},
{"settabwinvar", 4, 4, FEARG_4, NULL,
ret_void, f_settabwinvar},
{"settagstack", 2, 3, FEARG_2, NULL,
! ret_number_bool, f_settagstack},
{"setwinvar", 3, 3, FEARG_3, NULL,
ret_void, f_setwinvar},
{"sha256", 1, 1, FEARG_1, NULL,
***************
*** 1506,1514 ****
{"sign_placelist", 1, 1, FEARG_1, NULL,
ret_list_number, SIGN_FUNC(f_sign_placelist)},
{"sign_undefine", 0, 1, FEARG_1, NULL,
! ret_number, SIGN_FUNC(f_sign_undefine)},
{"sign_unplace", 1, 2, FEARG_1, NULL,
! ret_number, SIGN_FUNC(f_sign_unplace)},
{"sign_unplacelist", 1, 2, FEARG_1, NULL,
ret_list_number, SIGN_FUNC(f_sign_unplacelist)},
{"simplify", 1, 1, FEARG_1, NULL,
--- 1511,1519 ----
{"sign_placelist", 1, 1, FEARG_1, NULL,
ret_list_number, SIGN_FUNC(f_sign_placelist)},
{"sign_undefine", 0, 1, FEARG_1, NULL,
! ret_number_bool, SIGN_FUNC(f_sign_undefine)},
{"sign_unplace", 1, 2, FEARG_1, NULL,
! ret_number_bool, SIGN_FUNC(f_sign_unplace)},
{"sign_unplacelist", 1, 2, FEARG_1, NULL,
ret_list_number, SIGN_FUNC(f_sign_unplacelist)},
{"simplify", 1, 1, FEARG_1, NULL,
***************
*** 1788,1794 ****
{"win_gettype", 0, 1, FEARG_1, NULL,
ret_string, f_win_gettype},
{"win_gotoid", 1, 1, FEARG_1, NULL,
! ret_number, f_win_gotoid},
{"win_id2tabwin", 1, 1, FEARG_1, NULL,
ret_list_number, f_win_id2tabwin},
{"win_id2win", 1, 1, FEARG_1, NULL,
--- 1793,1799 ----
{"win_gettype", 0, 1, FEARG_1, NULL,
ret_string, f_win_gettype},
{"win_gotoid", 1, 1, FEARG_1, NULL,
! ret_number_bool, f_win_gotoid},
{"win_id2tabwin", 1, 1, FEARG_1, NULL,
ret_list_number, f_win_id2tabwin},
{"win_id2win", 1, 1, FEARG_1, NULL,
***************
*** 1796,1802 ****
{"win_screenpos", 1, 1, FEARG_1, NULL,
ret_list_number, f_win_screenpos},
{"win_splitmove", 2, 3, FEARG_1, NULL,
! ret_number, f_win_splitmove},
{"winbufnr", 1, 1, FEARG_1, NULL,
ret_number, f_winbufnr},
{"wincol", 0, 0, 0, NULL,
--- 1801,1807 ----
{"win_screenpos", 1, 1, FEARG_1, NULL,
ret_list_number, f_win_screenpos},
{"win_splitmove", 2, 3, FEARG_1, NULL,
! ret_number_bool, f_win_splitmove},
{"winbufnr", 1, 1, FEARG_1, NULL,
ret_number, f_winbufnr},
{"wincol", 0, 0, 0, NULL,
***************
*** 1822,1828 ****
{"wordcount", 0, 0, 0, NULL,
ret_dict_number, f_wordcount},
{"writefile", 2, 3, FEARG_1, NULL,
! ret_number, f_writefile},
{"xor", 2, 2, FEARG_1, NULL,
ret_number, f_xor},
};
--- 1827,1833 ----
{"wordcount", 0, 0, 0, NULL,
ret_dict_number, f_wordcount},
{"writefile", 2, 3, FEARG_1, NULL,
! ret_number_bool, f_writefile},
{"xor", 2, 2, FEARG_1, NULL,
ret_number, f_xor},
};
***************
*** 8310,8316 ****
* "setcursorcharpos" function
*/
static void
! f_setcursorcharpos(typval_T *argvars, typval_T *rettv UNUSED)
{
set_cursorpos(argvars, rettv, TRUE);
}
--- 8315,8321 ----
* "setcursorcharpos" function
*/
static void
! f_setcursorcharpos(typval_T *argvars, typval_T *rettv)
{
set_cursorpos(argvars, rettv, TRUE);
}
*** ../vim-8.2.2368/src/testdir/test_vim9_builtin.vim 2021-01-16
19:01:48.944919906 +0100
--- src/testdir/test_vim9_builtin.vim 2021-01-17 15:13:54.710144040 +0100
***************
*** 115,120 ****
--- 115,135 ----
CheckDefExecFailure(lines, 'E1131:', 2)
enddef
+ def Test_append()
+ new
+ setline(1, range(3))
+ var res1: number = append(1, 'one')
+ assert_equal(0, res1)
+ var res2: bool = append(3, 'two')
+ assert_equal(false, res2)
+ assert_equal(['0', 'one', '1', 'two', '2'], getline(1, 6))
+ enddef
+
+ def Test_buflisted()
+ var res: bool = buflisted('asdf')
+ assert_equal(false, res)
+ enddef
+
def Test_bufname()
split SomeFile
bufname('%')->assert_equal('SomeFile')
***************
*** 199,204 ****
--- 214,224 ----
CheckDefExecAndScriptFailure(lines, 'E475:')
enddef
+ def Test_delete()
+ var res: bool = delete('doesnotexist')
+ assert_equal(true, res)
+ enddef
+
def Test_executable()
assert_false(executable(""))
assert_false(executable(test_null_string()))
*** ../vim-8.2.2368/src/testdir/test_vim9_disassemble.vim 2021-01-12
18:58:36.443811813 +0100
--- src/testdir/test_vim9_disassemble.vim 2021-01-17 16:15:22.821743148
+0100
***************
*** 762,768 ****
'if has("gui_running")\_s*' ..
'\d PUSHS "gui_running"\_s*' ..
'\d BCALL has(argc 1)\_s*' ..
! '\d COND2BOOL\_s*' ..
'\d JUMP_IF_FALSE -> \d\_s*' ..
' echo "yes"\_s*' ..
'\d PUSHS "yes"\_s*' ..
--- 762,768 ----
'if has("gui_running")\_s*' ..
'\d PUSHS "gui_running"\_s*' ..
'\d BCALL has(argc 1)\_s*' ..
! '\d 2BOOL (!!val)\_s*' ..
'\d JUMP_IF_FALSE -> \d\_s*' ..
' echo "yes"\_s*' ..
'\d PUSHS "yes"\_s*' ..
*** ../vim-8.2.2368/src/version.c 2021-01-17 13:47:59.894514152 +0100
--- src/version.c 2021-01-17 14:56:43.908697377 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2369,
/**/
--
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "[email protected]" and refer to your
children as "forked processes."
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202101171516.10HFGr0u615191%40masaka.moolenaar.net.