Mercurial > vim
comparison src/vim9execute.c @ 20339:7587d892c00c v8.2.0725
patch 8.2.0725: Vim9: cannot call a function declared later in Vim9 script
Commit: https://github.com/vim/vim/commit/09689a02840be40fa7bb10b1921fb5bc5b2908f1
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 9 22:50:08 2020 +0200
patch 8.2.0725: Vim9: cannot call a function declared later in Vim9 script
Problem: Vim9: cannot call a function declared later in Vim9 script.
Solution: Make two passes through the script file.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 09 May 2020 23:00:04 +0200 |
parents | e1a8d2040bd7 |
children | cf2620e7a6aa |
comparison
equal
deleted
inserted
replaced
20338:ff4ae3f09307 | 20339:7587d892c00c |
---|---|
667 | 667 |
668 CLEAR_FIELD(ectx); | 668 CLEAR_FIELD(ectx); |
669 ga_init2(&ectx.ec_stack, sizeof(typval_T), 500); | 669 ga_init2(&ectx.ec_stack, sizeof(typval_T), 500); |
670 if (ga_grow(&ectx.ec_stack, 20) == FAIL) | 670 if (ga_grow(&ectx.ec_stack, 20) == FAIL) |
671 return FAIL; | 671 return FAIL; |
672 { | |
673 // Check the function was compiled, it is postponed in ex_vim9script(). | |
674 dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) | |
675 + ufunc->uf_dfunc_idx; | |
676 if (dfunc->df_instr == NULL) | |
677 return FAIL; | |
678 } | |
672 ectx.ec_dfunc_idx = ufunc->uf_dfunc_idx; | 679 ectx.ec_dfunc_idx = ufunc->uf_dfunc_idx; |
673 | 680 |
674 ga_init2(&ectx.ec_trystack, sizeof(trycmd_T), 10); | 681 ga_init2(&ectx.ec_trystack, sizeof(trycmd_T), 10); |
675 | 682 |
676 // Put arguments on the stack. | 683 // Put arguments on the stack. |