patch 8.2.0149: maintaining a Vim9 branch separately is more work
Problem: Maintaining a Vim9 branch separately is more work.
Solution: Merge the Vim9 script changes.
diff --git a/src/proto/blob.pro b/src/proto/blob.pro
index 706a83e..3bc6625 100644
--- a/src/proto/blob.pro
+++ b/src/proto/blob.pro
@@ -2,7 +2,7 @@
blob_T *blob_alloc(void);
int rettv_blob_alloc(typval_T *rettv);
void rettv_blob_set(typval_T *rettv, blob_T *b);
-int blob_copy(typval_T *from, typval_T *to);
+int blob_copy(blob_T *from, typval_T *to);
void blob_free(blob_T *b);
void blob_unref(blob_T *b);
long blob_len(blob_T *b);
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
index b086079..14b5f26 100644
--- a/src/proto/eval.pro
+++ b/src/proto/eval.pro
@@ -27,7 +27,12 @@
int pattern_match(char_u *pat, char_u *text, int ic);
int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate);
int eval1(char_u **arg, typval_T *rettv, int evaluate);
+void eval_addblob(typval_T *tv1, typval_T *tv2);
+int eval_addlist(typval_T *tv1, typval_T *tv2);
int get_option_tv(char_u **arg, typval_T *rettv, int evaluate);
+int get_number_tv(char_u **arg, typval_T *rettv, int evaluate, int want_string);
+int get_string_tv(char_u **arg, typval_T *rettv, int evaluate);
+int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate);
char_u *partial_name(partial_T *pt);
void partial_unref(partial_T *pt);
int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive);
@@ -43,6 +48,7 @@
char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID);
char_u *string_quote(char_u *str, int function);
int string2float(char_u *text, float_T *value);
+int get_env_tv(char_u **arg, typval_T *rettv, int evaluate);
pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum);
int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp);
int get_env_len(char_u **arg);
@@ -66,6 +72,7 @@
char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
void copy_tv(typval_T *from, typval_T *to);
int item_copy(typval_T *from, typval_T *to, int deep, int copyID);
+void echo_one(typval_T *rettv, int with_space, int *atstart, int *needclr);
void ex_echo(exarg_T *eap);
void ex_echohl(exarg_T *eap);
int get_echo_attr(void);
diff --git a/src/proto/evalfunc.pro b/src/proto/evalfunc.pro
index 064f12f..59ff35c 100644
--- a/src/proto/evalfunc.pro
+++ b/src/proto/evalfunc.pro
@@ -1,8 +1,13 @@
/* evalfunc.c */
char_u *get_function_name(expand_T *xp, int idx);
char_u *get_expr_name(expand_T *xp, int idx);
+int find_internal_func(char_u *name);
int has_internal_func(char_u *name);
+char *internal_func_name(int idx);
+type_T *internal_func_ret_type(int idx, int argcount);
+int check_internal_func(int idx, int argcount);
int call_internal_func(char_u *name, int argcount, typval_T *argvars, typval_T *rettv);
+void call_internal_func_by_idx(int idx, typval_T *argvars, typval_T *rettv);
int call_internal_method(char_u *name, int argcount, typval_T *argvars, typval_T *rettv, typval_T *basetv);
int non_zero_arg(typval_T *argvars);
linenr_T tv_get_lnum(typval_T *argvars);
@@ -13,6 +18,7 @@
void execute_redir_str(char_u *value, int value_len);
void execute_common(typval_T *argvars, typval_T *rettv, int arg_off);
void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv);
+void range_list_materialize(list_T *list);
float_T vim_round(float_T f);
long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, typval_T *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit);
void f_string(typval_T *argvars, typval_T *rettv);
diff --git a/src/proto/evalvars.pro b/src/proto/evalvars.pro
index bb8b5a1..1d557f5 100644
--- a/src/proto/evalvars.pro
+++ b/src/proto/evalvars.pro
@@ -13,10 +13,11 @@
int get_spellword(list_T *list, char_u **pp);
void prepare_vimvar(int idx, typval_T *save_tv);
void restore_vimvar(int idx, typval_T *save_tv);
+list_T *heredoc_get(exarg_T *eap, char_u *cmd);
void ex_let(exarg_T *eap);
void ex_const(exarg_T *eap);
-int ex_let_vars(char_u *arg_start, typval_T *tv, int copy, int semicolon, int var_count, int is_const, char_u *op);
-char_u *skip_var_list(char_u *arg, int *var_count, int *semicolon);
+int ex_let_vars(char_u *arg_start, typval_T *tv, int copy, int semicolon, int var_count, int flags, char_u *op);
+char_u *skip_var_list(char_u *arg, int include_type, int *var_count, int *semicolon);
void list_hashtable_vars(hashtab_T *ht, char *prefix, int empty, int *first);
void ex_unlet(exarg_T *eap);
void ex_lockvar(exarg_T *eap);
@@ -27,8 +28,10 @@
dict_T *get_globvar_dict(void);
hashtab_T *get_globvar_ht(void);
dict_T *get_vimvar_dict(void);
+int find_vim_var(char_u *name);
void set_vim_var_type(int idx, vartype_T type);
void set_vim_var_nr(int idx, varnumber_T val);
+char *get_vim_var_name(int idx);
typval_T *get_vim_var_tv(int idx);
varnumber_T get_vim_var_nr(int idx);
char_u *get_vim_var_str(int idx);
@@ -50,6 +53,8 @@
void check_vars(char_u *name, int len);
dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload);
dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);
+hashtab_T *get_script_local_ht(void);
+int lookup_scriptvar(char_u *name, size_t len, cctx_T *dummy);
hashtab_T *find_var_ht(char_u *name, char_u **varname);
char_u *get_var_value(char_u *name);
void new_script_vars(scid_T id);
@@ -58,7 +63,7 @@
void vars_clear(hashtab_T *ht);
void vars_clear_ext(hashtab_T *ht, int free_val);
void set_var(char_u *name, typval_T *tv, int copy);
-void set_var_const(char_u *name, typval_T *tv, int copy, int is_const);
+void set_var_const(char_u *name, type_T *type, typval_T *tv, int copy, int flags);
int var_check_ro(int flags, char_u *name, int use_gettext);
int var_check_fixed(int flags, char_u *name, int use_gettext);
int var_check_func_name(char_u *name, int new_var);
diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro
index f5942f5..af70e2d 100644
--- a/src/proto/ex_docmd.pro
+++ b/src/proto/ex_docmd.pro
@@ -7,6 +7,7 @@
int parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only);
int parse_cmd_address(exarg_T *eap, char **errormsg, int silent);
int checkforcmd(char_u **pp, char *cmd, int len);
+char_u *find_ex_command(exarg_T *eap, int *full, int (*lookup)(char_u *, size_t, cctx_T *), cctx_T *cctx);
int modifier_len(char_u *cmd);
int cmd_exists(char_u *name);
cmdidx_T excmd_get_cmdidx(char_u *cmd, int len);
diff --git a/src/proto/ex_eval.pro b/src/proto/ex_eval.pro
index bd68eea..929f479 100644
--- a/src/proto/ex_eval.pro
+++ b/src/proto/ex_eval.pro
@@ -8,7 +8,9 @@
void do_errthrow(cstack_T *cstack, char_u *cmdname);
int do_intthrow(cstack_T *cstack);
char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free);
+int throw_exception(void *value, except_type_T type, char_u *cmdname);
void discard_current_exception(void);
+void catch_exception(except_T *excp);
void report_make_pending(int pending, void *value);
void ex_eval(exarg_T *eap);
void ex_if(exarg_T *eap);
diff --git a/src/proto/list.pro b/src/proto/list.pro
index ae8a732..d60463d 100644
--- a/src/proto/list.pro
+++ b/src/proto/list.pro
@@ -3,6 +3,8 @@
void list_rem_watch(list_T *l, listwatch_T *lwrem);
list_T *list_alloc(void);
list_T *list_alloc_id(alloc_id_T id);
+list_T *list_alloc_with_items(int count);
+void list_set_item(list_T *l, int idx, typval_T *tv);
int rettv_list_alloc(typval_T *rettv);
int rettv_list_alloc_id(typval_T *rettv, alloc_id_T id);
void rettv_list_set(typval_T *rettv, list_T *l);
@@ -11,7 +13,8 @@
void list_free_items(int copyID);
void list_free(list_T *l);
listitem_T *listitem_alloc(void);
-void listitem_free(listitem_T *item);
+void list_free_item(list_T *l, listitem_T *item);
+void listitem_free(list_T *l, listitem_T *item);
void listitem_remove(list_T *l, listitem_T *item);
long list_len(list_T *l);
int list_equal(list_T *l1, list_T *l2, int ic, int recursive);
@@ -21,6 +24,7 @@
long list_idx_of_item(list_T *l, listitem_T *item);
void list_append(list_T *l, listitem_T *item);
int list_append_tv(list_T *l, typval_T *tv);
+int list_append_tv_move(list_T *l, typval_T *tv);
int list_append_dict(list_T *list, dict_T *dict);
int list_append_list(list_T *list1, list_T *list2);
int list_append_string(list_T *l, char_u *str, int len);
@@ -34,7 +38,7 @@
char_u *list2string(typval_T *tv, int copyID, int restore_copyID);
int list_join(garray_T *gap, list_T *l, char_u *sep, int echo_style, int restore_copyID, int copyID);
void f_join(typval_T *argvars, typval_T *rettv);
-int get_list_tv(char_u **arg, typval_T *rettv, int evaluate);
+int get_list_tv(char_u **arg, typval_T *rettv, int evaluate, int do_error);
int write_list(FILE *fd, list_T *list, int binary);
void init_static_list(staticList10_T *sl);
void f_list2str(typval_T *argvars, typval_T *rettv);
diff --git a/src/proto/message.pro b/src/proto/message.pro
index a34ca3d..5c9ca6c 100644
--- a/src/proto/message.pro
+++ b/src/proto/message.pro
@@ -13,6 +13,7 @@
void iemsg(char *s);
void internal_error(char *where);
void emsg_invreg(int name);
+void emsg_namelen(char *msg, char_u *name, int len);
char *msg_trunc_attr(char *s, int force, int attr);
char_u *msg_may_trunc(int force, char_u *s);
int delete_first_msg(void);
diff --git a/src/proto/scriptfile.pro b/src/proto/scriptfile.pro
index 7972e84..111e855 100644
--- a/src/proto/scriptfile.pro
+++ b/src/proto/scriptfile.pro
@@ -8,7 +8,7 @@
int do_in_path(char_u *path, char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie);
int do_in_runtimepath(char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie);
int source_runtime(char_u *name, int flags);
-int source_in_path(char_u *path, char_u *name, int flags);
+int source_in_path(char_u *path, char_u *name, int flags, int *ret_sid);
void add_pack_start_dirs(void);
void load_start_packages(void);
void ex_packloadall(exarg_T *eap);
@@ -21,7 +21,7 @@
linenr_T *source_breakpoint(void *cookie);
int *source_dbg_tick(void *cookie);
int source_level(void *cookie);
-int do_source(char_u *fname, int check_other, int is_vimrc);
+int do_source(char_u *fname, int check_other, int is_vimrc, int *ret_sid);
void ex_scriptnames(exarg_T *eap);
void scriptnames_slash_adjust(void);
char_u *get_scriptname(scid_T id);
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro
index 06f41e4..74bcabd 100644
--- a/src/proto/userfunc.pro
+++ b/src/proto/userfunc.pro
@@ -1,26 +1,32 @@
/* userfunc.c */
void func_init(void);
hashtab_T *func_tbl_get(void);
+int get_function_args(char_u **argp, char_u endchar, garray_T *newargs, garray_T *argtypes, int *varargs, garray_T *default_args, int skip);
int get_lambda_tv(char_u **arg, typval_T *rettv, int evaluate);
char_u *deref_func_name(char_u *name, int *lenp, partial_T **partialp, int no_autoload);
void emsg_funcname(char *ermsg, char_u *name);
int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, funcexe_T *funcexe);
-ufunc_T *find_func(char_u *name);
+ufunc_T *find_func(char_u *name, cctx_T *cctx);
+int call_user_func_check(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, funcexe_T *funcexe, dict_T *selfdict);
void save_funccal(funccal_entry_T *entry);
void restore_funccal(void);
funccall_T *get_current_funccal(void);
void free_all_functions(void);
+int builtin_function(char_u *name, int len);
int func_call(char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv);
int get_callback_depth(void);
int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount, typval_T *argvars);
+void user_func_error(int error, char_u *name);
int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe);
char_u *trans_function_name(char_u **pp, int skip, int flags, funcdict_T *fdp, partial_T **partial);
void ex_function(exarg_T *eap);
int eval_fname_script(char_u *p);
int translated_function_exists(char_u *name);
+int has_varargs(ufunc_T *ufunc);
int function_exists(char_u *name, int no_deref);
char_u *get_expanded_name(char_u *name, int check);
char_u *get_user_func_name(expand_T *xp, int idx);
+void clean_script_functions(int sid);
void ex_delfunction(exarg_T *eap);
void func_unref(char_u *name);
void func_ptr_unref(ufunc_T *fp);
diff --git a/src/proto/vim9compile.pro b/src/proto/vim9compile.pro
new file mode 100644
index 0000000..4f06e9d
--- /dev/null
+++ b/src/proto/vim9compile.pro
@@ -0,0 +1,14 @@
+/* vim9compile.c */
+char_u *skip_type(char_u *start);
+type_T *parse_type(char_u **arg, garray_T *type_list);
+char *vartype_name(vartype_T type);
+char *type_name(type_T *type, char **tofree);
+int get_script_item_idx(int sid, char_u *name, int check_writable);
+imported_T *find_imported(char_u *name, cctx_T *cctx);
+char_u *to_name_end(char_u *arg);
+char_u *to_name_const_end(char_u *arg);
+int assignment_len(char_u *p, int *heredoc);
+void compile_def_function(ufunc_T *ufunc, int set_return_type);
+void delete_def_function(ufunc_T *ufunc);
+void free_def_functions(void);
+/* vim: set ft=c : */
diff --git a/src/proto/vim9execute.pro b/src/proto/vim9execute.pro
new file mode 100644
index 0000000..4f7262d
--- /dev/null
+++ b/src/proto/vim9execute.pro
@@ -0,0 +1,6 @@
+/* vim9execute.c */
+int call_def_function(ufunc_T *ufunc, int argc, typval_T *argv, typval_T *rettv);
+void ex_disassemble(exarg_T *eap);
+int tv2bool(typval_T *tv);
+int check_not_string(typval_T *tv);
+/* vim: set ft=c : */
diff --git a/src/proto/vim9script.pro b/src/proto/vim9script.pro
new file mode 100644
index 0000000..29fa269
--- /dev/null
+++ b/src/proto/vim9script.pro
@@ -0,0 +1,8 @@
+/* vim9script.c */
+int in_vim9script(void);
+void ex_vim9script(exarg_T *eap);
+void ex_export(exarg_T *eap);
+void free_imports(int sid);
+void ex_import(exarg_T *eap);
+char_u *handle_import(char_u *arg_start, garray_T *gap, int sid);
+/* vim: set ft=c : */