Mercurial > vim
comparison src/structs.h @ 20528:489cb75c76b6 v8.2.0818
patch 8.2.0818: Vim9: using a discovery phase doesn't work well
Commit: https://github.com/vim/vim/commit/822ba24743af9ee1b5e7f656a7a61a38f3638bca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 24 23:00:18 2020 +0200
patch 8.2.0818: Vim9: using a discovery phase doesn't work well
Problem: Vim9: using a discovery phase doesn't work well.
Solution: Remove the discovery phase, instead compile a function only when
it is used. Add :defcompile to compile def functions earlier.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 24 May 2020 23:15:04 +0200 |
parents | bc2c9ea94ec1 |
children | 9f921ba86d05 |
comparison
equal
deleted
inserted
replaced
20527:37ac4c5b4d27 | 20528:489cb75c76b6 |
---|---|
1514 }; | 1514 }; |
1515 | 1515 |
1516 #if defined(FEAT_EVAL) || defined(PROTO) | 1516 #if defined(FEAT_EVAL) || defined(PROTO) |
1517 typedef struct funccall_S funccall_T; | 1517 typedef struct funccall_S funccall_T; |
1518 | 1518 |
1519 # define UF_NOT_COMPILED -2 | |
1520 # define UF_TO_BE_COMPILED -1 | |
1521 | |
1519 /* | 1522 /* |
1520 * Structure to hold info for a user function. | 1523 * Structure to hold info for a user function. |
1521 */ | 1524 */ |
1522 typedef struct | 1525 typedef struct |
1523 { | 1526 { |
1524 int uf_varargs; // variable nr of arguments (old style) | 1527 int uf_varargs; // variable nr of arguments (old style) |
1525 int uf_flags; // FC_ flags | 1528 int uf_flags; // FC_ flags |
1526 int uf_calls; // nr of active calls | 1529 int uf_calls; // nr of active calls |
1527 int uf_cleared; // func_clear() was already called | 1530 int uf_cleared; // func_clear() was already called |
1528 int uf_dfunc_idx; // >= 0 for :def function only | 1531 int uf_dfunc_idx; // UF_NOT_COMPILED, UF_TO_BE_COMPILED or >= 0 |
1529 garray_T uf_args; // arguments, including optional arguments | 1532 garray_T uf_args; // arguments, including optional arguments |
1530 garray_T uf_def_args; // default argument expressions | 1533 garray_T uf_def_args; // default argument expressions |
1531 | 1534 |
1532 // for :def (for :function uf_ret_type is NULL) | 1535 // for :def (for :function uf_ret_type is NULL) |
1533 type_T **uf_arg_types; // argument types (count == uf_args.ga_len) | 1536 type_T **uf_arg_types; // argument types (count == uf_args.ga_len) |