aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval/userfunc.h')
-rw-r--r--src/nvim/eval/userfunc.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h
index c8583f232c..8050caab2b 100644
--- a/src/nvim/eval/userfunc.h
+++ b/src/nvim/eval/userfunc.h
@@ -1,22 +1,21 @@
-#ifndef NVIM_EVAL_USERFUNC_H
-#define NVIM_EVAL_USERFUNC_H
+#pragma once
#include <stdbool.h>
#include <stddef.h>
-#include "nvim/eval/typval.h"
+#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
+#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
-#include "nvim/ex_cmds_defs.h"
-#include "nvim/garray.h"
-#include "nvim/hashtab.h"
-#include "nvim/pos.h"
-#include "nvim/types.h"
+#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
+#include "nvim/hashtab_defs.h" // IWYU pragma: keep
+#include "nvim/pos_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
struct funccal_entry;
// From user function to hashitem and back.
#define UF2HIKEY(fp) ((fp)->uf_name)
-#define HIKEY2UF(p) ((ufunc_T *)(p - offsetof(ufunc_T, uf_name)))
+#define HIKEY2UF(p) ((ufunc_T *)((p) - offsetof(ufunc_T, uf_name)))
#define HI2UF(hi) HIKEY2UF((hi)->hi_key)
// flags used in uf_flags
@@ -27,10 +26,10 @@ struct funccal_entry;
#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_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_VIM9 0x400 // defined in vim9 script file
#define FC_LUAREF 0x800 // luaref callback
/// Structure used by trans_function_name()
@@ -74,6 +73,8 @@ typedef struct {
partial_T *fe_partial; ///< for extra arguments
dict_T *fe_selfdict; ///< Dictionary for "self"
typval_T *fe_basetv; ///< base for base->method()
+ bool fe_found_var; ///< if the function is not found then give an
+ ///< error that a variable is not callable.
} funcexe_T;
#define FUNCEXE_INIT (funcexe_T) { \
@@ -85,6 +86,7 @@ typedef struct {
.fe_partial = NULL, \
.fe_selfdict = NULL, \
.fe_basetv = NULL, \
+ .fe_found_var = false, \
}
#define FUNCARG(fp, j) ((char **)(fp->uf_args.ga_data))[j]
@@ -93,4 +95,3 @@ typedef struct {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/userfunc.h.generated.h"
#endif
-#endif // NVIM_EVAL_USERFUNC_H