1
0
forked from aniani/vim

patch 9.0.1074: class members are not supported yet

Problem:    Class members are not supported yet.
Solution:   Add initial support for class members.
This commit is contained in:
Bram Moolenaar
2022-12-18 21:42:55 +00:00
parent 731d00770d
commit d505d17885
13 changed files with 578 additions and 215 deletions

View File

@@ -278,17 +278,16 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type)
{
for (int i = 0; i < cl->class_obj_member_count; ++i)
{
objmember_T *m = &cl->class_obj_members[i];
if (STRNCMP(name, m->om_name, len) == 0 && m->om_name[len] == NUL)
ocmember_T *m = &cl->class_obj_members[i];
if (STRNCMP(name, m->ocm_name, len) == 0 && m->ocm_name[len] == NUL)
{
if (*name == '_' && cctx->ctx_ufunc->uf_class != cl)
{
semsg(_(e_cannot_access_private_object_member_str),
m->om_name);
semsg(_(e_cannot_access_private_member_str), m->ocm_name);
return FAIL;
}
generate_GET_OBJ_MEMBER(cctx, i, m->om_type);
generate_GET_OBJ_MEMBER(cctx, i, m->ocm_type);
*arg = name_end;
return OK;