annotate src/proto/typval.pro @ 33532:f99f5a56ff27 v9.0.2015

patch 9.0.2015: Vim9: does not handle islocked() from a method correctly Commit: https://github.com/vim/vim/commit/4c8da025ef8140168b7a09d9fe922ce4bb40f19d Author: Ernie Rael <errael@raelity.com> Date: Wed Oct 11 21:35:11 2023 +0200 patch 9.0.2015: Vim9: does not handle islocked() from a method correctly Problem: Vim9: does not handle islocked() from a method correctly Solution: Handle islocked() builtin from a method. - Setup `lval_root` from `f_islocked()`. - Add function `fill_exec_lval_root()` to get info about executing method. - `sync_root` added in get_lval to handle method member access. - Conservative approach to reference counting. closes: #13309 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ernie Rael <errael@raelity.com>
author Christian Brabandt <cb@256bit.org>
date Wed, 11 Oct 2023 21:45:04 +0200
parents e4851934751a
children 288da62613ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 /* typval.c */
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 typval_T *alloc_tv(void);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 typval_T *alloc_string_tv(char_u *s);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 void free_tv(typval_T *varp);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 void clear_tv(typval_T *varp);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 void init_tv(typval_T *varp);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 varnumber_T tv_get_number(typval_T *varp);
32130
ec0d5bd9083c patch 9.0.1396: sort(list, 'N') does not work in Vim9 script context
Bram Moolenaar <Bram@vim.org>
parents: 31604
diff changeset
8 varnumber_T tv_to_number(typval_T *varp);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 varnumber_T tv_get_number_chk(typval_T *varp, int *denote);
21851
727820154b1a patch 8.2.1475: Vim9: can't use v:true for option flags
Bram Moolenaar <Bram@vim.org>
parents: 21120
diff changeset
10 varnumber_T tv_get_bool(typval_T *varp);
21861
cd8dafe937ba patch 8.2.1480: Vim9: skip expression in search() gives error
Bram Moolenaar <Bram@vim.org>
parents: 21851
diff changeset
11 varnumber_T tv_get_bool_chk(typval_T *varp, int *denote);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 float_T tv_get_float(typval_T *varp);
28674
38f7a132bba3 patch 8.2.4861: it is not easy to restore saved mappings
Bram Moolenaar <Bram@vim.org>
parents: 27924
diff changeset
13 int check_for_unknown_arg(typval_T *args, int idx);
24246
35603c7991d7 patch 8.2.2664: Vim9: not enough function arguments checked for string
Bram Moolenaar <Bram@vim.org>
parents: 24210
diff changeset
14 int check_for_string_arg(typval_T *args, int idx);
35603c7991d7 patch 8.2.2664: Vim9: not enough function arguments checked for string
Bram Moolenaar <Bram@vim.org>
parents: 24210
diff changeset
15 int check_for_nonempty_string_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
16 int check_for_opt_string_arg(typval_T *args, int idx);
25252
acda780ffc3e patch 8.2.3162: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25198
diff changeset
17 int check_for_number_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
18 int check_for_opt_number_arg(typval_T *args, int idx);
25368
1ffa8eb30353 patch 8.2.3221: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25348
diff changeset
19 int check_for_float_or_nr_arg(typval_T *args, int idx);
25272
712e867f9721 patch 8.2.3173: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25252
diff changeset
20 int check_for_bool_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
21 int check_for_opt_bool_arg(typval_T *args, int idx);
25806
8d55e978f95b patch 8.2.3438: cannot manipulate blobs
Bram Moolenaar <Bram@vim.org>
parents: 25390
diff changeset
22 int check_for_blob_arg(typval_T *args, int idx);
25272
712e867f9721 patch 8.2.3173: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25252
diff changeset
23 int check_for_list_arg(typval_T *args, int idx);
30015
adb0de8be4ce patch 9.0.0345: error message for list argument could be clearer
Bram Moolenaar <Bram@vim.org>
parents: 29994
diff changeset
24 int check_for_nonnull_list_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
25 int check_for_opt_list_arg(typval_T *args, int idx);
25198
eafc0e07b188 patch 8.2.3135: Vim9: builtin function arguments not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 24246
diff changeset
26 int check_for_dict_arg(typval_T *args, int idx);
29994
86eb4aba16c3 patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents: 28813
diff changeset
27 int check_for_nonnull_dict_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
28 int check_for_opt_dict_arg(typval_T *args, int idx);
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
29 int check_for_chan_or_job_arg(typval_T *args, int idx);
25348
75031a22be39 patch 8.2.3211: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25338
diff changeset
30 int check_for_opt_chan_or_job_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
31 int check_for_job_arg(typval_T *args, int idx);
25384
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
32 int check_for_opt_job_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
33 int check_for_string_or_number_arg(typval_T *args, int idx);
26644
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
34 int check_for_opt_string_or_number_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
35 int check_for_buffer_arg(typval_T *args, int idx);
25314
7e620652bd13 patch 8.2.3194: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25302
diff changeset
36 int check_for_opt_buffer_arg(typval_T *args, int idx);
25302
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
37 int check_for_lnum_arg(typval_T *args, int idx);
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
38 int check_for_opt_lnum_arg(typval_T *args, int idx);
4d3c68196d05 patch 8.2.3188: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25272
diff changeset
39 int check_for_string_or_blob_arg(typval_T *args, int idx);
25314
7e620652bd13 patch 8.2.3194: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25302
diff changeset
40 int check_for_string_or_list_arg(typval_T *args, int idx);
26638
6fd15d82e898 patch 8.2.3848: cannot use reduce() for a string
Bram Moolenaar <Bram@vim.org>
parents: 26585
diff changeset
41 int check_for_string_or_list_or_blob_arg(typval_T *args, int idx);
25368
1ffa8eb30353 patch 8.2.3221: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25348
diff changeset
42 int check_for_opt_string_or_list_arg(typval_T *args, int idx);
25384
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
43 int check_for_string_or_dict_arg(typval_T *args, int idx);
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
44 int check_for_string_or_number_or_list_arg(typval_T *args, int idx);
25390
a6c347a0c6e3 patch 8.2.3232: system() does not work without a second argument
Bram Moolenaar <Bram@vim.org>
parents: 25384
diff changeset
45 int check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx);
30188
ba22d5536d3e patch 9.0.0430: cannot use repeat() with a blob
Bram Moolenaar <Bram@vim.org>
parents: 30015
diff changeset
46 int check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx);
25384
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
47 int check_for_string_or_list_or_dict_arg(typval_T *args, int idx);
26731
7f4cc4e58f75 patch 8.2.3894: Vim9: no proper type check for first argument of call()
Bram Moolenaar <Bram@vim.org>
parents: 26644
diff changeset
48 int check_for_string_or_func_arg(typval_T *args, int idx);
25338
e2be9f3c5907 patch 8.2.3206: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25314
diff changeset
49 int check_for_list_or_blob_arg(typval_T *args, int idx);
25384
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
50 int check_for_list_or_dict_arg(typval_T *args, int idx);
25338
e2be9f3c5907 patch 8.2.3206: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25314
diff changeset
51 int check_for_list_or_dict_or_blob_arg(typval_T *args, int idx);
26585
0d2a709e2ff0 patch 8.2.3822: leaking memory in map() and filter(), no string in Vim9
Bram Moolenaar <Bram@vim.org>
parents: 25806
diff changeset
52 int check_for_list_or_dict_or_blob_or_string_arg(typval_T *args, int idx);
25384
e8e2c4d33b9b patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Bram Moolenaar <Bram@vim.org>
parents: 25368
diff changeset
53 int check_for_opt_buffer_or_dict_arg(typval_T *args, int idx);
32972
e4851934751a patch 9.0.1786: Vim9: need instanceof() function
Christian Brabandt <cb@256bit.org>
parents: 32130
diff changeset
54 int check_for_object_arg(typval_T *args, int idx);
e4851934751a patch 9.0.1786: Vim9: need instanceof() function
Christian Brabandt <cb@256bit.org>
parents: 32130
diff changeset
55 int check_for_class_or_list_arg(typval_T *args, int idx);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 char_u *tv_get_string(typval_T *varp);
23786
0512923e54e1 patch 8.2.2434: Vim9: no error when compiling str2nr() with a number
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
57 char_u *tv_get_string_strict(typval_T *varp);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 char_u *tv_get_string_buf(typval_T *varp, char_u *buf);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 char_u *tv_get_string_chk(typval_T *varp);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
23786
0512923e54e1 patch 8.2.2434: Vim9: no error when compiling str2nr() with a number
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
61 char_u *tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict);
21120
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
62 char_u *tv_stringify(typval_T *varp, char_u *buf);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
63 int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
64 void copy_tv(typval_T *from, typval_T *to);
26644
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
65 int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic);
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
66 int typval_compare_list(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
27924
e6e3abc28c7a patch 8.2.4487: Vim9: cannot compare with v:null
Bram Moolenaar <Bram@vim.org>
parents: 26731
diff changeset
67 int typval_compare_null(typval_T *tv1, typval_T *tv2);
26644
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
68 int typval_compare_blob(typval_T *tv1, typval_T *tv2, exprtype_T type, int *res);
31604
9b13b3a63bc0 patch 9.0.1134: comparing objects uses identity instead of equality
Bram Moolenaar <Bram@vim.org>
parents: 30188
diff changeset
69 int typval_compare_class(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
9b13b3a63bc0 patch 9.0.1134: comparing objects uses identity instead of equality
Bram Moolenaar <Bram@vim.org>
parents: 30188
diff changeset
70 int typval_compare_object(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
26644
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
71 int typval_compare_dict(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
72 int typval_compare_func(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
2fc1e528e0e1 patch 8.2.3851: Vim9: overhead when comparing string, dict or function
Bram Moolenaar <Bram@vim.org>
parents: 26638
diff changeset
73 int typval_compare_string(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
23788
d12ef361d9de patch 8.2.2435: setline() gives an error for some types
Bram Moolenaar <Bram@vim.org>
parents: 23786
diff changeset
74 char_u *typval_tostring(typval_T *arg, int quotes);
21120
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
75 int tv_islocked(typval_T *tv);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
76 int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
77 int eval_option(char_u **arg, typval_T *rettv, int evaluate);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
78 int eval_number(char_u **arg, typval_T *rettv, int evaluate, int want_string);
28813
3626ca6a20ea patch 8.2.4930: interpolated string expression requires escaping
Bram Moolenaar <Bram@vim.org>
parents: 28718
diff changeset
79 int eval_string(char_u **arg, typval_T *rettv, int evaluate, int interpolate);
3626ca6a20ea patch 8.2.4930: interpolated string expression requires escaping
Bram Moolenaar <Bram@vim.org>
parents: 28718
diff changeset
80 int eval_lit_string(char_u **arg, typval_T *rettv, int evaluate, int interpolate);
3626ca6a20ea patch 8.2.4930: interpolated string expression requires escaping
Bram Moolenaar <Bram@vim.org>
parents: 28718
diff changeset
81 int eval_interp_string(char_u **arg, typval_T *rettv, int evaluate);
21120
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
82 char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID);
4d844a65183d patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
83 int eval_env_var(char_u **arg, typval_T *rettv, int evaluate);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 linenr_T tv_get_lnum(typval_T *argvars);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 linenr_T tv_get_lnum_buf(typval_T *argvars, buf_T *buf);
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 buf_T *tv_get_buf(typval_T *tv, int curtab_only);
22025
71f886a48ef5 patch 8.2.1562: Vim9: error when using "%" where a buffer is expected
Bram Moolenaar <Bram@vim.org>
parents: 21861
diff changeset
87 buf_T *tv_get_buf_from_arg(typval_T *tv);
20587
f502455965c0 patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 /* vim: set ft=c : */