Mercurial > vim
comparison src/regexp.c @ 17606:ff097edaae89 v8.1.1800
patch 8.1.1800: function call functions have too many arguments
commit https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 3 18:17:11 2019 +0200
patch 8.1.1800: function call functions have too many arguments
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Aug 2019 18:30:07 +0200 |
parents | f4ce361bb1e5 |
children | 121bdff812b4 |
comparison
equal
deleted
inserted
replaced
17605:bb1b495f4e05 | 17606:ff097edaae89 |
---|---|
7414 rsm.sm_line_lbr = rex.reg_line_lbr; | 7414 rsm.sm_line_lbr = rex.reg_line_lbr; |
7415 | 7415 |
7416 if (expr != NULL) | 7416 if (expr != NULL) |
7417 { | 7417 { |
7418 typval_T argv[2]; | 7418 typval_T argv[2]; |
7419 int dummy; | |
7420 char_u buf[NUMBUFLEN]; | 7419 char_u buf[NUMBUFLEN]; |
7421 typval_T rettv; | 7420 typval_T rettv; |
7422 staticList10_T matchList; | 7421 staticList10_T matchList; |
7422 funcexe_T funcexe; | |
7423 | 7423 |
7424 rettv.v_type = VAR_STRING; | 7424 rettv.v_type = VAR_STRING; |
7425 rettv.vval.v_string = NULL; | 7425 rettv.vval.v_string = NULL; |
7426 argv[0].v_type = VAR_LIST; | 7426 argv[0].v_type = VAR_LIST; |
7427 argv[0].vval.v_list = &matchList.sl_list; | 7427 argv[0].vval.v_list = &matchList.sl_list; |
7428 matchList.sl_list.lv_len = 0; | 7428 matchList.sl_list.lv_len = 0; |
7429 vim_memset(&funcexe, 0, sizeof(funcexe)); | |
7430 funcexe.argv_func = fill_submatch_list; | |
7431 funcexe.evaluate = TRUE; | |
7429 if (expr->v_type == VAR_FUNC) | 7432 if (expr->v_type == VAR_FUNC) |
7430 { | 7433 { |
7431 s = expr->vval.v_string; | 7434 s = expr->vval.v_string; |
7432 call_func(s, -1, &rettv, | 7435 call_func(s, -1, &rettv, 1, argv, &funcexe); |
7433 1, argv, fill_submatch_list, | |
7434 0L, 0L, &dummy, TRUE, NULL, NULL); | |
7435 } | 7436 } |
7436 else if (expr->v_type == VAR_PARTIAL) | 7437 else if (expr->v_type == VAR_PARTIAL) |
7437 { | 7438 { |
7438 partial_T *partial = expr->vval.v_partial; | 7439 partial_T *partial = expr->vval.v_partial; |
7439 | 7440 |
7440 s = partial_name(partial); | 7441 s = partial_name(partial); |
7441 call_func(s, -1, &rettv, | 7442 funcexe.partial = partial; |
7442 1, argv, fill_submatch_list, | 7443 call_func(s, -1, &rettv, 1, argv, &funcexe); |
7443 0L, 0L, &dummy, TRUE, partial, NULL); | |
7444 } | 7444 } |
7445 if (matchList.sl_list.lv_len > 0) | 7445 if (matchList.sl_list.lv_len > 0) |
7446 /* fill_submatch_list() was called */ | 7446 /* fill_submatch_list() was called */ |
7447 clear_submatch_list(&matchList); | 7447 clear_submatch_list(&matchList); |
7448 | 7448 |