Mercurial > vim
comparison src/evalfunc.c @ 32417:3c2c1cb61004 v9.0.1540
patch 9.0.1540: reverse() on string doesn't work in compiled function
Commit: https://github.com/vim/vim/commit/f9dc278946d52235a0025fd347bd9ff571258470
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Thu May 11 15:02:56 2023 +0100
patch 9.0.1540: reverse() on string doesn't work in compiled function
Problem: reverse() on string doesn't work in compiled function.
Solution: Accept string in argument type check. (Yegappan Lakshmanan,
closes #12377)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 11 May 2023 16:15:08 +0200 |
parents | b9a8d1c453e1 |
children | aa64fdad1f60 |
comparison
equal
deleted
inserted
replaced
32416:06997bf5e6a8 | 32417:3c2c1cb61004 |
---|---|
755 arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); | 755 arg_type_mismatch(&t_list_any, type, context->arg_idx + 1); |
756 return FAIL; | 756 return FAIL; |
757 } | 757 } |
758 | 758 |
759 /* | 759 /* |
760 * Check "type" is a modifiable list of 'any' or a blob or a string. | |
761 */ | |
762 static int | |
763 arg_string_list_or_blob_mod(type_T *type, type_T *decl_type, argcontext_T *context) | |
764 { | |
765 if (arg_string_list_or_blob(type, decl_type, context) == FAIL) | |
766 return FAIL; | |
767 return arg_type_modifiable(type, context->arg_idx + 1); | |
768 } | |
769 | |
770 /* | |
760 * Check "type" is a job. | 771 * Check "type" is a job. |
761 */ | 772 */ |
762 static int | 773 static int |
763 arg_job(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) | 774 arg_job(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) |
764 { | 775 { |
1008 static argcheck_T arg1_dict_or_string[] = {arg_dict_any_or_string}; | 1019 static argcheck_T arg1_dict_or_string[] = {arg_dict_any_or_string}; |
1009 static argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; | 1020 static argcheck_T arg1_float_or_nr[] = {arg_float_or_nr}; |
1010 static argcheck_T arg1_job[] = {arg_job}; | 1021 static argcheck_T arg1_job[] = {arg_job}; |
1011 static argcheck_T arg1_list_any[] = {arg_list_any}; | 1022 static argcheck_T arg1_list_any[] = {arg_list_any}; |
1012 static argcheck_T arg1_list_number[] = {arg_list_number}; | 1023 static argcheck_T arg1_list_number[] = {arg_list_number}; |
1013 static argcheck_T arg1_list_or_blob_mod[] = {arg_list_or_blob_mod}; | 1024 static argcheck_T arg1_string_or_list_or_blob_mod[] = {arg_string_list_or_blob_mod}; |
1014 static argcheck_T arg1_list_or_dict[] = {arg_list_or_dict}; | 1025 static argcheck_T arg1_list_or_dict[] = {arg_list_or_dict}; |
1015 static argcheck_T arg1_list_string[] = {arg_list_string}; | 1026 static argcheck_T arg1_list_string[] = {arg_list_string}; |
1016 static argcheck_T arg1_string_or_list_or_dict[] = {arg_string_or_list_or_dict}; | 1027 static argcheck_T arg1_string_or_list_or_dict[] = {arg_string_or_list_or_dict}; |
1017 static argcheck_T arg1_lnum[] = {arg_lnum}; | 1028 static argcheck_T arg1_lnum[] = {arg_lnum}; |
1018 static argcheck_T arg1_number[] = {arg_number}; | 1029 static argcheck_T arg1_number[] = {arg_number}; |
2411 ret_number_bool, f_rename}, | 2422 ret_number_bool, f_rename}, |
2412 {"repeat", 2, 2, FEARG_1, arg2_repeat, | 2423 {"repeat", 2, 2, FEARG_1, arg2_repeat, |
2413 ret_repeat, f_repeat}, | 2424 ret_repeat, f_repeat}, |
2414 {"resolve", 1, 1, FEARG_1, arg1_string, | 2425 {"resolve", 1, 1, FEARG_1, arg1_string, |
2415 ret_string, f_resolve}, | 2426 ret_string, f_resolve}, |
2416 {"reverse", 1, 1, FEARG_1, arg1_list_or_blob_mod, | 2427 {"reverse", 1, 1, FEARG_1, arg1_string_or_list_or_blob_mod, |
2417 ret_first_arg, f_reverse}, | 2428 ret_first_arg, f_reverse}, |
2418 {"round", 1, 1, FEARG_1, arg1_float_or_nr, | 2429 {"round", 1, 1, FEARG_1, arg1_float_or_nr, |
2419 ret_float, f_round}, | 2430 ret_float, f_round}, |
2420 {"rubyeval", 1, 1, FEARG_1, arg1_string, | 2431 {"rubyeval", 1, 1, FEARG_1, arg1_string, |
2421 ret_any, | 2432 ret_any, |