Mercurial > vim
annotate src/proto/vim9class.pro @ 34684:faf891660963 v9.1.0223
patch 9.1.0223: code duplication in loop to add active text properties
Commit: https://github.com/vim/vim/commit/1134fdd1b369119d0d6992e3120bb5f7c788b697
Author: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Date: Thu Mar 28 11:49:46 2024 +0100
patch 9.1.0223: code duplication in loop to add active text properties
Problem: There are two dense conditions with duplication that needs to
be kept in sync between the while loop break condition and the
condition to skip certain text properties.
Solution: Refactor the loop by moving while loop conditions into the
body of the while loop so they can be shared with skip
conditions. `break` and an `active` variable are used to
handle the outcome of these merged conditions.
(Dylan Thacker-Smith)
closes: #14307
Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Mar 2024 12:00:05 +0100 |
parents | 5b25ec43f208 |
children | c10c6d293ef7 |
rev | line source |
---|---|
31335
5acc0d2cf4f7
patch 9.0.1001: classes are not documented or implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 /* vim9class.c */ |
33387
577ef266309d
patch 9.0.1952: Vim9: unused static field
Christian Brabandt <cb@256bit.org>
parents:
33286
diff
changeset
|
2 int object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl); |
34472
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
3 int is_valid_builtin_obj_methodname(char_u *funcname); |
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
4 ufunc_T *class_get_builtin_method(class_T *cl, class_builtin_T builtin_method, int *method_idx); |
31335
5acc0d2cf4f7
patch 9.0.1001: classes are not documented or implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 void ex_class(exarg_T *eap); |
34676
5b25ec43f208
patch 9.1.0219: Vim9: No enum support
Christian Brabandt <cb@256bit.org>
parents:
34472
diff
changeset
|
6 void enum_set_internal_obj_vars(class_T *en, object_T *enval); |
33534
c8bd88bdb630
patch 9.0.2016: Vim9: assignment operators don't work for class vars
Christian Brabandt <cb@256bit.org>
parents:
33506
diff
changeset
|
7 type_T *oc_member_type(class_T *cl, int is_object, char_u *name, char_u *name_end, int *member_idx); |
c8bd88bdb630
patch 9.0.2016: Vim9: assignment operators don't work for class vars
Christian Brabandt <cb@256bit.org>
parents:
33506
diff
changeset
|
8 type_T *oc_member_type_by_idx(class_T *cl, int is_object, int member_idx); |
31335
5acc0d2cf4f7
patch 9.0.1001: classes are not documented or implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 void ex_enum(exarg_T *eap); |
33678
7d9d2404a3d4
patch 9.0.2076: Vim9: No support for type aliases
Christian Brabandt <cb@256bit.org>
parents:
33540
diff
changeset
|
10 void typealias_free(typealias_T *ta); |
7d9d2404a3d4
patch 9.0.2076: Vim9: No support for type aliases
Christian Brabandt <cb@256bit.org>
parents:
33540
diff
changeset
|
11 void typealias_unref(typealias_T *ta); |
31335
5acc0d2cf4f7
patch 9.0.1001: classes are not documented or implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 void ex_type(exarg_T *eap); |
31396
307f68a41b03
patch 9.0.1031: Vim9 class is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
31335
diff
changeset
|
13 int class_object_index(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int verbose); |
31424
e31fc75f6aff
patch 9.0.1045: in a class object members cannot be initialized
Bram Moolenaar <Bram@vim.org>
parents:
31404
diff
changeset
|
14 ufunc_T *find_class_func(char_u **arg); |
33233
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
15 int class_member_idx(class_T *cl, char_u *name, size_t namelen); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
16 ocmember_T *class_member_lookup(class_T *cl, char_u *name, size_t namelen, int *idx); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
17 int class_method_idx(class_T *cl, char_u *name, size_t namelen); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
18 ocmember_T *object_member_lookup(class_T *cl, char_u *name, size_t namelen, int *idx); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
19 int object_method_idx(class_T *cl, char_u *name, size_t namelen); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
20 ocmember_T *member_lookup(class_T *cl, vartype_T v_type, char_u *name, size_t namelen, int *idx); |
108d890d887f
patch 9.0.1890: Vim9: lookup code for class/object repaeated
Christian Brabandt <cb@256bit.org>
parents:
33227
diff
changeset
|
21 ufunc_T *method_lookup(class_T *cl, vartype_T v_type, char_u *name, size_t namelen, int *idx); |
31815
64f03e860c91
patch 9.0.1240: cannot access a private object member in a lambda
Bram Moolenaar <Bram@vim.org>
parents:
31754
diff
changeset
|
22 int inside_class(cctx_T *cctx_arg, class_T *cl); |
33951
45a50fd59a73
patch 9.0.2170: Vim9: no support for const/final class/objects vars
Christian Brabandt <cb@256bit.org>
parents:
33678
diff
changeset
|
23 int oc_var_check_ro(class_T *cl, ocmember_T *m); |
45a50fd59a73
patch 9.0.2170: Vim9: no support for const/final class/objects vars
Christian Brabandt <cb@256bit.org>
parents:
33678
diff
changeset
|
24 void obj_lock_const_vars(object_T *obj); |
31396
307f68a41b03
patch 9.0.1031: Vim9 class is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
31335
diff
changeset
|
25 void copy_object(typval_T *from, typval_T *to); |
307f68a41b03
patch 9.0.1031: Vim9 class is not implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
31335
diff
changeset
|
26 void copy_class(typval_T *from, typval_T *to); |
31404
60b1d266548d
patch 9.0.1035: object members are not being marked as used
Bram Moolenaar <Bram@vim.org>
parents:
31396
diff
changeset
|
27 void class_unref(class_T *cl); |
33160
4ecf54d709b3
patch 9.0.1862: Vim9 Garbage Collection issues
Christian Brabandt <cb@256bit.org>
parents:
33109
diff
changeset
|
28 int class_free_nonref(int copyID); |
4ecf54d709b3
patch 9.0.1862: Vim9 Garbage Collection issues
Christian Brabandt <cb@256bit.org>
parents:
33109
diff
changeset
|
29 int set_ref_in_classes(int copyID); |
31404
60b1d266548d
patch 9.0.1035: object members are not being marked as used
Bram Moolenaar <Bram@vim.org>
parents:
31396
diff
changeset
|
30 void object_created(object_T *obj); |
33540
86dbcbb94fdb
patch 9.0.2019: Vim9: no support for funcrefs
Christian Brabandt <cb@256bit.org>
parents:
33534
diff
changeset
|
31 void object_unref(object_T *obj); |
31404
60b1d266548d
patch 9.0.1035: object members are not being marked as used
Bram Moolenaar <Bram@vim.org>
parents:
31396
diff
changeset
|
32 int object_free_nonref(int copyID); |
33540
86dbcbb94fdb
patch 9.0.2019: Vim9: no support for funcrefs
Christian Brabandt <cb@256bit.org>
parents:
33534
diff
changeset
|
33 void object_free_items(int copyID); |
34053
19cdfe768104
patch 9.0.2190: proto files need update
Christian Brabandt <cb@256bit.org>
parents:
33951
diff
changeset
|
34 void emsg_var_cl_define(char *msg, char_u *name, size_t len, class_T *cl); |
33260
aba1fa2b7d1e
patch 9.0.1898: Vim9: restrict access to static vars
Christian Brabandt <cb@256bit.org>
parents:
33233
diff
changeset
|
35 void method_not_found_msg(class_T *cl, vartype_T v_type, char_u *name, size_t len); |
aba1fa2b7d1e
patch 9.0.1898: Vim9: restrict access to static vars
Christian Brabandt <cb@256bit.org>
parents:
33233
diff
changeset
|
36 void member_not_found_msg(class_T *cl, vartype_T v_type, char_u *name, size_t len); |
34112
0f2632b04cde
patch 9.1.0020: Vim9: cannot compile all methods in a class
Christian Brabandt <cb@256bit.org>
parents:
34053
diff
changeset
|
37 void defcompile_class(class_T *cl); |
0f2632b04cde
patch 9.1.0020: Vim9: cannot compile all methods in a class
Christian Brabandt <cb@256bit.org>
parents:
34053
diff
changeset
|
38 void defcompile_classes_in_script(void); |
0f2632b04cde
patch 9.1.0020: Vim9: cannot compile all methods in a class
Christian Brabandt <cb@256bit.org>
parents:
34053
diff
changeset
|
39 int is_class_name(char_u *name, typval_T *rettv); |
34472
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
40 void protected_method_access_errmsg(char_u *method_name); |
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
41 int object_empty(object_T *obj); |
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
42 int object_len(object_T *obj); |
5c1a025192ed
patch 9.1.0148: Vim9: can't call internal methods with objects
Christian Brabandt <cb@256bit.org>
parents:
34112
diff
changeset
|
43 char_u *object_string(object_T *obj, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); |
34053
19cdfe768104
patch 9.0.2190: proto files need update
Christian Brabandt <cb@256bit.org>
parents:
33951
diff
changeset
|
44 int class_instance_of(class_T *cl, class_T *other_cl); |
32972
e4851934751a
patch 9.0.1786: Vim9: need instanceof() function
Christian Brabandt <cb@256bit.org>
parents:
31843
diff
changeset
|
45 void f_instanceof(typval_T *argvars, typval_T *rettv); |
31335
5acc0d2cf4f7
patch 9.0.1001: classes are not documented or implemented yet
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 /* vim: set ft=c : */ |