aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /src/nvim/eval.h
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'src/nvim/eval.h')
-rw-r--r--src/nvim/eval.h53
1 files changed, 35 insertions, 18 deletions
diff --git a/src/nvim/eval.h b/src/nvim/eval.h
index 86bc76e793..1fc2891917 100644
--- a/src/nvim/eval.h
+++ b/src/nvim/eval.h
@@ -1,15 +1,18 @@
-#ifndef NVIM_EVAL_H
-#define NVIM_EVAL_H
+#pragma once
#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/event/time.h"
#include "nvim/ex_cmds_defs.h"
-#include "nvim/hashtab.h"
+#include "nvim/globals.h"
+#include "nvim/hashtab_defs.h"
+#include "nvim/macros_defs.h"
#include "nvim/os/fileio.h"
#include "nvim/os/stdpaths_defs.h"
@@ -51,11 +54,11 @@ typedef struct lval_S {
list_T *ll_list; ///< The list or NULL.
bool ll_range; ///< true when a [i:j] range was used.
bool ll_empty2; ///< Second index is empty: [i:].
- long ll_n1; ///< First index for list.
- long ll_n2; ///< Second index for list range.
+ int ll_n1; ///< First index for list.
+ int ll_n2; ///< Second index for list range.
dict_T *ll_dict; ///< The Dictionary or NULL.
dictitem_T *ll_di; ///< The dictitem or NULL.
- char *ll_newkey; ///< New key for Dict in allocated memory or NULL.
+ char *ll_newkey; ///< New key for Dict in allocated memory or NULL.
blob_T *ll_blob; ///< The Blob or NULL.
} lval_T;
@@ -157,6 +160,7 @@ typedef enum {
VV_ARGV,
VV_COLLATE,
VV_EXITING,
+ VV_MAXCOL,
// Nvim
VV_STDERR,
VV_MSGPACK_TYPES,
@@ -222,22 +226,12 @@ typedef struct {
int repeat_count;
int refcount;
int emsg_count; ///< Errors in a repeating timer.
- long timeout;
+ int64_t timeout;
bool stopped;
bool paused;
Callback callback;
} timer_T;
-/// Type of assert_* check being performed
-typedef enum {
- ASSERT_EQUAL,
- ASSERT_NOTEQUAL,
- ASSERT_MATCH,
- ASSERT_NOTMATCH,
- ASSERT_INRANGE,
- ASSERT_OTHER,
-} assert_type_T;
-
/// types for expressions.
typedef enum {
EXPR_UNKNOWN = 0,
@@ -265,7 +259,30 @@ typedef int (*ex_unletlock_callback)(lval_T *, char *, exarg_T *, int);
// Used for checking if local variables or arguments used in a lambda.
extern bool *eval_lavars_used;
+/// Struct passed through eval() functions.
+/// See EVALARG_EVALUATE for a fixed value with eval_flags set to EVAL_EVALUATE.
+typedef struct {
+ int eval_flags; ///< EVAL_ flag values below
+
+ /// copied from exarg_T when "getline" is "getsourceline". Can be NULL.
+ LineGetter eval_getline;
+ void *eval_cookie; ///< argument for eval_getline()
+
+ /// pointer to the last line obtained with getsourceline()
+ char *eval_tofree;
+} evalarg_T;
+
+/// Flag for expression evaluation.
+enum {
+ EVAL_EVALUATE = 1, ///< when missing don't actually evaluate
+};
+
+// Character used as separated in autoload function/variable names.
+#define AUTOLOAD_CHAR '#'
+
+/// Passed to an eval() function to enable evaluation.
+EXTERN evalarg_T EVALARG_EVALUATE INIT( = { EVAL_EVALUATE, NULL, NULL, NULL });
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval.h.generated.h"
#endif
-#endif // NVIM_EVAL_H