diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-03-03 16:26:58 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-03 16:34:51 +0100 |
commit | d3eae7bc116297f70220f21ded436ed0a88066d8 (patch) | |
tree | 29837ff70cabc4f3238be13df845dcb6ace10da9 /src/structs.h | |
parent | 215703563757a4464907ead6fb9edaeb7f430bea (diff) |
patch 9.1.0148: Vim9: can't call internal methods with objectsv9.1.0148
Problem: Vim9: can't call internal methods with objects
Solution: Add support for empty(), len() and string() function
calls for objects (Yegappan Lakshmanan)
closes: #14129
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/structs.h')
-rw-r--r-- | src/structs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/structs.h b/src/structs.h index df2c005e3d..2c6f553521 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1531,6 +1531,17 @@ typedef enum { #define OCMFLAG_CONST 0x04 // "const" object/class member /* + * Object methods called by builtin functions (e.g. string(), empty(), etc.) + */ +typedef enum { + CLASS_BUILTIN_INVALID, + CLASS_BUILTIN_STRING, + CLASS_BUILTIN_EMPTY, + CLASS_BUILTIN_LEN, + CLASS_BUILTIN_MAX +} class_builtin_T; + +/* * Entry for an object or class member variable. */ typedef struct { @@ -1593,6 +1604,9 @@ struct class_S int class_obj_method_count_child; // count without "extends" ufunc_T **class_obj_methods; // allocated + // index of builtin methods + int class_builtin_methods[CLASS_BUILTIN_MAX]; + garray_T class_type_list; // used for type pointers type_T class_type; // type used for the class type_T class_object_type; // same as class_type but VAR_OBJECT |