0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0512: Vim9: no optional arguments in func type

Problem:    Vim9: no optional arguments in func type.
Solution:   Check for question mark after type.  Find function reference
            without function().
This commit is contained in:
Bram Moolenaar
2020-04-05 17:08:17 +02:00
parent d7ffc0ba8c
commit 5deeb3f1f9
13 changed files with 729 additions and 455 deletions

View File

@@ -1341,10 +1341,11 @@ typedef enum
typedef struct type_S type_T;
struct type_S {
vartype_T tt_type;
short tt_argcount; // for func, partial, -1 for unknown
short tt_flags; // TTFLAG_ values
char tt_argcount; // for func, -1 for unknown
char tt_min_argcount; // number of non-optional arguments
char tt_flags; // TTFLAG_ values
type_T *tt_member; // for list, dict, func return type
type_T **tt_args; // func arguments, allocated
type_T **tt_args; // func argument types, allocated
};
#define TTFLAG_VARARGS 1 // func args ends with "..."
@@ -1520,7 +1521,7 @@ typedef struct
int uf_calls; // nr of active calls
int uf_cleared; // func_clear() was already called
int uf_dfunc_idx; // >= 0 for :def function only
garray_T uf_args; // arguments
garray_T uf_args; // arguments, including optional arguments
garray_T uf_def_args; // default argument expressions
// for :def (for :function uf_ret_type is NULL)
@@ -1531,6 +1532,7 @@ typedef struct
// uf_def_args; length: uf_def_args.ga_len + 1
char_u *uf_va_name; // name from "...name" or NULL
type_T *uf_va_type; // type from "...name: type" or NULL
type_T *uf_func_type; // type of the function, &t_func_any if unknown
garray_T uf_lines; // function lines
# ifdef FEAT_PROFILE