patch 9.0.1031: Vim9 class is not implemented yet
Problem: Vim9 class is not implemented yet.
Solution: Add very basic class support.
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro
index ee17049..5c865ce 100644
--- a/src/proto/userfunc.pro
+++ b/src/proto/userfunc.pro
@@ -7,6 +7,7 @@
int get_lambda_tv(char_u **arg, typval_T *rettv, int types_optional, evalarg_T *evalarg);
char_u *deref_func_name(char_u *name, int *lenp, partial_T **partialp, type_T **type, int no_autoload, int new_function, int *found_var);
void emsg_funcname(char *ermsg, char_u *name);
+int get_func_arguments(char_u **arg, evalarg_T *evalarg, int partial_argc, typval_T *argvars, int *argcount);
int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, evalarg_T *evalarg, funcexe_T *funcexe);
char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error);
void func_name_with_sid(char_u *name, int sid, char_u *buffer);
@@ -45,7 +46,7 @@
char_u *alloc_printable_func_name(char_u *fname);
char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, funcdict_T *fudi);
void list_functions(regmatch_T *regmatch);
-ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free);
+ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free, class_T *class_arg);
void ex_function(exarg_T *eap);
ufunc_T *find_func_by_name(char_u *name, compiletype_T *compile_type);
void ex_defcompile(exarg_T *eap);
diff --git a/src/proto/vim9class.pro b/src/proto/vim9class.pro
index 4e55178..4c6e12d 100644
--- a/src/proto/vim9class.pro
+++ b/src/proto/vim9class.pro
@@ -1,6 +1,12 @@
/* vim9class.c */
void ex_class(exarg_T *eap);
+type_T *class_member_type(class_T *cl, char_u *name, char_u *name_end, int *member_idx);
void ex_interface(exarg_T *eap);
void ex_enum(exarg_T *eap);
void ex_type(exarg_T *eap);
+int class_object_index(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int verbose);
+void copy_object(typval_T *from, typval_T *to);
+void object_unref(object_T *obj);
+void copy_class(typval_T *from, typval_T *to);
+void class_unref(typval_T *tv);
/* vim: set ft=c : */
diff --git a/src/proto/vim9instr.pro b/src/proto/vim9instr.pro
index 87914f3..04d7682 100644
--- a/src/proto/vim9instr.pro
+++ b/src/proto/vim9instr.pro
@@ -3,6 +3,7 @@
isn_T *generate_instr_drop(cctx_T *cctx, isntype_T isn_type, int drop);
isn_T *generate_instr_type(cctx_T *cctx, isntype_T isn_type, type_T *type);
isn_T *generate_instr_debug(cctx_T *cctx);
+int generate_CONSTRUCT(cctx_T *cctx, class_T *cl);
int may_generate_2STRING(int offset, int tolerant, cctx_T *cctx);
int generate_add_instr(cctx_T *cctx, vartype_T vartype, type_T *type1, type_T *type2, exprtype_T expr_type);
vartype_T operator_type(type_T *type1, type_T *type2);
diff --git a/src/proto/vim9script.pro b/src/proto/vim9script.pro
index 0e98039..9a0bcdf 100644
--- a/src/proto/vim9script.pro
+++ b/src/proto/vim9script.pro
@@ -19,5 +19,5 @@
void hide_script_var(scriptitem_T *si, int idx, int func_defined);
svar_T *find_typval_in_script(typval_T *dest, scid_T sid, int must_find);
int check_script_var_type(svar_T *sv, typval_T *value, char_u *name, where_T where);
-int check_reserved_name(char_u *name);
+int check_reserved_name(char_u *name, cctx_T *cctx);
/* vim: set ft=c : */
diff --git a/src/proto/vim9type.pro b/src/proto/vim9type.pro
index 3c86092..98c6091 100644
--- a/src/proto/vim9type.pro
+++ b/src/proto/vim9type.pro
@@ -1,4 +1,5 @@
/* vim9type.c */
+type_T *get_type_ptr(garray_T *type_gap);
type_T *copy_type(type_T *type, garray_T *type_gap);
void clear_type_list(garray_T *gap);
type_T *alloc_type(type_T *type);