diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-06 22:23:54 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-09-07 00:52:58 +0200 |
commit | db9b8b08e74ae8cfb08960eca0a7273538ebcdf1 (patch) | |
tree | 1e6406f2c83fd8c278c8521f778b4f0f2fee0920 /src/nvim/eval/userfunc.h | |
parent | 74a8b5982a27cdccc6505343a9feeba1b3e74e31 (diff) | |
download | rneovim-db9b8b08e74ae8cfb08960eca0a7273538ebcdf1.tar.gz rneovim-db9b8b08e74ae8cfb08960eca0a7273538ebcdf1.tar.bz2 rneovim-db9b8b08e74ae8cfb08960eca0a7273538ebcdf1.zip |
refactor(typval): change FC_CFUNC abstraction into FC_LUAREF
"cfuncs" was only ever used to wrap luarefs. As vim8script is
finished and will not be developed further, support for "cfuncs"
for other usecases are not planned. This abstraction was immediately
broken anyway in order to get luarefs out of userfuncs again.
Even if a new kind of userfunc needs to be invented in the future,
likely just extending the FC_... flag union directy, instead of
invoking unnecessary heap object and c function pointer indirection,
will be a more straightforward design pattern.
Diffstat (limited to 'src/nvim/eval/userfunc.h')
-rw-r--r-- | src/nvim/eval/userfunc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h index 4b7007aae9..9811f2afb3 100644 --- a/src/nvim/eval/userfunc.h +++ b/src/nvim/eval/userfunc.h @@ -9,6 +9,20 @@ #define HIKEY2UF(p) ((ufunc_T *)(p - offsetof(ufunc_T, uf_name))) #define HI2UF(hi) HIKEY2UF((hi)->hi_key) +// flags used in uf_flags +#define FC_ABORT 0x01 // abort function on error +#define FC_RANGE 0x02 // function accepts range +#define FC_DICT 0x04 // Dict function, uses "self" +#define FC_CLOSURE 0x08 // closure, uses outer scope variables +#define FC_DELETED 0x10 // :delfunction used while uf_refcount > 0 +#define FC_REMOVED 0x20 // function redefined while uf_refcount > 0 +#define FC_SANDBOX 0x40 // function defined in the sandbox +#define FC_DEAD 0x80 // function kept only for reference to dfunc +#define FC_EXPORT 0x100 // "export def Func()" +#define FC_NOARGS 0x200 // no a: variables in lambda +#define FC_VIM9 0x400 // defined in vim9 script file +#define FC_LUAREF 0x800 // luaref callback + ///< Structure used by trans_function_name() typedef struct { dict_T *fd_dict; ///< Dictionary used. |