diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2021-08-26 04:26:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 04:26:32 -0700 |
commit | 4c499899b2c3b31d57c1911c522683bdb2e32a0a (patch) | |
tree | 73bd8630718e854355ae1cc9c4272838618b67c9 /src/nvim/eval/userfunc.h | |
parent | 2548a9e18037339c4c502d971bdeaf909b82a739 (diff) | |
parent | b2994e35c9357a8144beaf27e1a8ea4dd133f5d4 (diff) | |
download | rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.tar.gz rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.tar.bz2 rneovim-4c499899b2c3b31d57c1911c522683bdb2e32a0a.zip |
Merge #15293 Vimscript "method" syntax
Port VimL's method call syntax - vim-patch:8.1.{1638,1800,1803,1807,1809,1816,1820,1821,1828,1834,1835,1861,1863,1878,1879,1888,1909,1911,1912}
Diffstat (limited to 'src/nvim/eval/userfunc.h')
-rw-r--r-- | src/nvim/eval/userfunc.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h index e8ad0bf1da..3f111343d2 100644 --- a/src/nvim/eval/userfunc.h +++ b/src/nvim/eval/userfunc.h @@ -28,11 +28,37 @@ typedef enum { ERROR_OTHER, ERROR_BOTH, ERROR_DELETED, + ERROR_NOTMETHOD, } FnameTransError; +/// Used in funcexe_T. Returns the new argcount. typedef int (*ArgvFunc)(int current_argcount, typval_T *argv, int argskip, int called_func_argcount); +/// Structure passed between functions dealing with function call execution. +typedef struct { + ArgvFunc argv_func; ///< when not NULL, can be used to fill in arguments only + ///< when the invoked function uses them + linenr_T firstline; ///< first line of range + linenr_T lastline; ///< last line of range + bool *doesrange; ///< [out] if not NULL: function handled range + bool evaluate; ///< actually evaluate expressions + partial_T *partial; ///< for extra arguments + dict_T *selfdict; ///< Dictionary for "self" + typval_T *basetv; ///< base for base->method() +} funcexe_T; + +#define FUNCEXE_INIT (funcexe_T) { \ + .argv_func = NULL, \ + .firstline = 0, \ + .lastline = 0, \ + .doesrange = NULL, \ + .evaluate = false, \ + .partial = NULL, \ + .selfdict = NULL, \ + .basetv = NULL, \ +} + #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j] #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] |