annotate src/proto/eval.pro @ 34957:3cacfb652766 v9.1.0335

patch 9.1.0335: String interpolation fails for List type Commit: https://github.com/vim/vim/commit/bce51d9005dd1c5bc002acbac2e12b649abcb013 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Apr 15 19:19:52 2024 +0200 patch 9.1.0335: String interpolation fails for List type Problem: String interpolation fails for List type Solution: use implicit string(list) for string interpolation and :put = (Yegappan Lakshmanan) related: #14529 closes: #14556 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 15 Apr 2024 19:30:04 +0200
parents 19cdfe768104
children 500731fe8161
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* eval.c */
23679
e8c379b20765 patch 8.2.2381: Vim9: divide by zero does not abort expression execution
Bram Moolenaar <Bram@vim.org>
parents: 23628
diff changeset
2 varnumber_T num_divide(varnumber_T n1, varnumber_T n2, int *failed);
e8c379b20765 patch 8.2.2381: Vim9: divide by zero does not abort expression execution
Bram Moolenaar <Bram@vim.org>
parents: 23628
diff changeset
3 varnumber_T num_modulus(varnumber_T n1, varnumber_T n2, int *failed);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
4 void eval_init(void);
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
5 void eval_clear(void);
21118
b0baa80cb53f patch 8.2.1110: Vim9: line continuation does not work in function arguments
Bram Moolenaar <Bram@vim.org>
parents: 21058
diff changeset
6 void fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip);
30598
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
7 int eval_to_bool(char_u *arg, int *error, exarg_T *eap, int skip, int use_simple_function);
20731
ab27db64f1fb patch 8.2.0918: duplicate code for evaluating expression argument
Bram Moolenaar <Bram@vim.org>
parents: 20587
diff changeset
8 int eval_expr_valid_arg(typval_T *tv);
30566
b3de17181c19 patch 9.0.0618: calling function for reduce() has too much overhead
Bram Moolenaar <Bram@vim.org>
parents: 29771
diff changeset
9 funccall_T *eval_expr_get_funccal(typval_T *expr, typval_T *rettv);
34053
19cdfe768104 patch 9.0.2190: proto files need update
Christian Brabandt <cb@256bit.org>
parents: 33160
diff changeset
10 int eval_expr_typval(typval_T *expr, int want_func, typval_T *argv, int argc, funccall_T *fc_arg, typval_T *rettv);
12722
7749260f261c patch 8.0.1239: cannot use a lambda for the skip argument to searchpair()
Christian Brabandt <cb@256bit.org>
parents: 11181
diff changeset
11 int eval_expr_to_bool(typval_T *expr, int *error);
20996
3af71cbcfdbe patch 8.2.1049: Vim9: leaking memory when using continuation line
Bram Moolenaar <Bram@vim.org>
parents: 20992
diff changeset
12 char_u *eval_to_string_skip(char_u *arg, exarg_T *eap, int skip);
29771
c71a42be2d7f patch 9.0.0225: using freed memory with multiple line breaks in expression
Bram Moolenaar <Bram@vim.org>
parents: 28690
diff changeset
13 void init_evalarg(evalarg_T *evalarg);
c71a42be2d7f patch 9.0.0225: using freed memory with multiple line breaks in expression
Bram Moolenaar <Bram@vim.org>
parents: 28690
diff changeset
14 void clear_evalarg(evalarg_T *evalarg, exarg_T *eap);
22685
80b4e604d1d5 patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
15 int skip_expr(char_u **pp, evalarg_T *evalarg);
21220
ad13736a1783 patch 8.2.1161: Vim9: using freed memory
Bram Moolenaar <Bram@vim.org>
parents: 21148
diff changeset
16 int skip_expr_concatenate(char_u **arg, char_u **start, char_u **end, evalarg_T *evalarg);
34957
3cacfb652766 patch 9.1.0335: String interpolation fails for List type
Christian Brabandt <cb@256bit.org>
parents: 34053
diff changeset
17 char_u *typval2string(typval_T *tv, int join_list);
3cacfb652766 patch 9.1.0335: String interpolation fails for List type
Christian Brabandt <cb@256bit.org>
parents: 34053
diff changeset
18 char_u *eval_to_string_eap(char_u *arg, int join_list, exarg_T *eap, int use_simple_function);
3cacfb652766 patch 9.1.0335: String interpolation fails for List type
Christian Brabandt <cb@256bit.org>
parents: 34053
diff changeset
19 char_u *eval_to_string(char_u *arg, int join_list, int use_simple_function);
30598
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
20 char_u *eval_to_string_safe(char_u *arg, int use_sandbox, int keep_script_version, int use_simple_function);
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
21 varnumber_T eval_to_number(char_u *expr, int use_simple_function);
20996
3af71cbcfdbe patch 8.2.1049: Vim9: leaking memory when using continuation line
Bram Moolenaar <Bram@vim.org>
parents: 20992
diff changeset
22 typval_T *eval_expr(char_u *arg, exarg_T *eap);
30598
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
23 typval_T *eval_expr_ext(char_u *arg, exarg_T *eap, int use_simple_function);
14439
e4c553e9132b patch 8.1.0233: "safe" argument of call_vim_function() is always FALSE
Christian Brabandt <cb@256bit.org>
parents: 14393
diff changeset
24 int call_vim_function(char_u *func, int argc, typval_T *argv, typval_T *rettv);
e4c553e9132b patch 8.1.0233: "safe" argument of call_vim_function() is always FALSE
Christian Brabandt <cb@256bit.org>
parents: 14393
diff changeset
25 void *call_func_retstr(char_u *func, int argc, typval_T *argv);
e4c553e9132b patch 8.1.0233: "safe" argument of call_vim_function() is always FALSE
Christian Brabandt <cb@256bit.org>
parents: 14393
diff changeset
26 void *call_func_retlist(char_u *func, int argc, typval_T *argv);
27289
e11682ba8c80 patch 8.2.4173: cannot use an import in 'foldexpr'
Bram Moolenaar <Bram@vim.org>
parents: 26990
diff changeset
27 int eval_foldexpr(win_T *wp, int *cp);
9562
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
28 char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags);
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
29 void clear_lval(lval_T *lp);
23917
4b417b776b95 patch 8.2.2501: not always clear where an error is reported
Bram Moolenaar <Bram@vim.org>
parents: 23679
diff changeset
30 void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, int flags, char_u *op, int var_idx);
25591
ea69398b40d1 patch 8.2.3332: Vim9: cannot assign to range in list
Bram Moolenaar <Bram@vim.org>
parents: 25206
diff changeset
31 int tv_op(typval_T *tv1, typval_T *tv2, char_u *op);
21058
111f877e63d9 patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents: 21050
diff changeset
32 void *eval_for_line(char_u *arg, int *errp, exarg_T *eap, evalarg_T *evalarg);
111f877e63d9 patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents: 21050
diff changeset
33 void skip_for_lines(void *fi_void, evalarg_T *evalarg);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
34 int next_for_item(void *fi_void, char_u *arg);
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
35 void free_for_info(void *fi_void);
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
36 void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx);
17377
cb008de2a6ec patch 8.1.1687: the evalfunc.c file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17168
diff changeset
37 int pattern_match(char_u *pat, char_u *text, int ic);
26980
8796f1384750 patch 8.2.4019: Vim9: import mechanism is too complicated
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
38 char_u *eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext);
28690
9a7a2908e1a8 patch 8.2.4869: expression in command block does not look after NL
Bram Moolenaar <Bram@vim.org>
parents: 28002
diff changeset
39 char_u *eval_next_line(char_u *arg, evalarg_T *evalarg);
21046
0ca7e04d39e3 patch 8.2.1074: Vim9: no line break allowed after some operators
Bram Moolenaar <Bram@vim.org>
parents: 21040
diff changeset
40 char_u *skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg);
20996
3af71cbcfdbe patch 8.2.1049: Vim9: leaking memory when using continuation line
Bram Moolenaar <Bram@vim.org>
parents: 20992
diff changeset
41 int eval0(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg);
30598
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
42 int may_call_simple_func(char_u *arg, typval_T *rettv);
37aa9fd2ed72 patch 9.0.0634: evaluating "expr" options has more overhead than needed
Bram Moolenaar <Bram@vim.org>
parents: 30566
diff changeset
43 int eval0_simple_funccal(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg);
26980
8796f1384750 patch 8.2.4019: Vim9: import mechanism is too complicated
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
44 int eval0_retarg(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg, char_u **retarg);
20996
3af71cbcfdbe patch 8.2.1049: Vim9: leaking memory when using continuation line
Bram Moolenaar <Bram@vim.org>
parents: 20992
diff changeset
45 int eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg);
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents: 18966
diff changeset
46 void eval_addblob(typval_T *tv1, typval_T *tv2);
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents: 18966
diff changeset
47 int eval_addlist(typval_T *tv1, typval_T *tv2);
23525
54ec7c8b7459 patch 8.2.2305: Vim9: "++var" and "--var" are silently accepted
Bram Moolenaar <Bram@vim.org>
parents: 23281
diff changeset
48 int eval_leader(char_u **arg, int vim9);
28002
1012048eed26 patch 8.2.4526: Vim9: cannot set variables to a null value
Bram Moolenaar <Bram@vim.org>
parents: 27517
diff changeset
49 int handle_predefined(char_u *s, int len, typval_T *rettv);
21833
e3f9528bddda patch 8.2.1466: Vim9: cannot index or slice a variable with type "any"
Bram Moolenaar <Bram@vim.org>
parents: 21826
diff changeset
50 int check_can_index(typval_T *rettv, int evaluate, int verbose);
23604
1816ea68c022 patch 8.2.2344: using inclusive index for slice is not always desired
Bram Moolenaar <Bram@vim.org>
parents: 23563
diff changeset
51 void f_slice(typval_T *argvars, typval_T *rettv);
1816ea68c022 patch 8.2.2344: using inclusive index for slice is not always desired
Bram Moolenaar <Bram@vim.org>
parents: 23563
diff changeset
52 int eval_index_inner(typval_T *rettv, int is_range, typval_T *var1, typval_T *var2, int exclusive, char_u *key, int keylen, int verbose);
9723
80ac9cf77c9b commit https://github.com/vim/vim/commit/437bafe4c8a83ed71ee006eda7f54b65a90f0d4c
Christian Brabandt <cb@256bit.org>
parents: 9686
diff changeset
53 char_u *partial_name(partial_T *pt);
8863
e1b84109506a commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents: 8577
diff changeset
54 void partial_unref(partial_T *pt);
7712
bce3b5ddb393 commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Christian Brabandt <cb@256bit.org>
parents: 7668
diff changeset
55 int get_copyID(void);
8881
ed0b39dd7fd6 commit https://github.com/vim/vim/commit/ebf7dfa6f121c82f97d2adca3d45fbaba9ad8f7e
Christian Brabandt <cb@256bit.org>
parents: 8863
diff changeset
56 int garbage_collect(int testing);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
57 int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack);
17168
1d30eb64a7a2 patch 8.1.1583: set_ref_in_list() only sets ref in items
Bram Moolenaar <Bram@vim.org>
parents: 17079
diff changeset
58 int set_ref_in_dict(dict_T *d, int copyID);
1d30eb64a7a2 patch 8.1.1583: set_ref_in_list() only sets ref in items
Bram Moolenaar <Bram@vim.org>
parents: 17079
diff changeset
59 int set_ref_in_list(list_T *ll, int copyID);
1d30eb64a7a2 patch 8.1.1583: set_ref_in_list() only sets ref in items
Bram Moolenaar <Bram@vim.org>
parents: 17079
diff changeset
60 int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack);
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26441
diff changeset
61 int set_ref_in_callback(callback_T *cb, int copyID);
33160
4ecf54d709b3 patch 9.0.1862: Vim9 Garbage Collection issues
Christian Brabandt <cb@256bit.org>
parents: 32818
diff changeset
62 int set_ref_in_item_class(class_T *cl, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
63 int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack);
12722
7749260f261c patch 8.0.1239: cannot use a lambda for the skip argument to searchpair()
Christian Brabandt <cb@256bit.org>
parents: 11181
diff changeset
64 char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val);
9562
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
65 char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID);
23563
87671ccc6c6b patch 8.2.2324: not easy to get mark en cursor posotion by character count
Bram Moolenaar <Bram@vim.org>
parents: 23551
diff changeset
66 int buf_byteidx_to_charidx(buf_T *buf, int lnum, int byteidx);
87671ccc6c6b patch 8.2.2324: not easy to get mark en cursor posotion by character count
Bram Moolenaar <Bram@vim.org>
parents: 23551
diff changeset
67 int buf_charidx_to_byteidx(buf_T *buf, int lnum, int charidx);
87671ccc6c6b patch 8.2.2324: not easy to get mark en cursor posotion by character count
Bram Moolenaar <Bram@vim.org>
parents: 23551
diff changeset
68 pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum, int charcol);
23604
1816ea68c022 patch 8.2.2344: using inclusive index for slice is not always desired
Bram Moolenaar <Bram@vim.org>
parents: 23563
diff changeset
69 int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp, int charcol);
17873
d50a5faa75bd patch 8.1.1933: the eval.c file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17789
diff changeset
70 int get_env_len(char_u **arg);
9562
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
71 int get_id_len(char_u **arg);
17873
d50a5faa75bd patch 8.1.1933: the eval.c file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17789
diff changeset
72 int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose);
9562
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
73 char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags);
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
74 int eval_isnamec(int c);
86af4a48c00a commit https://github.com/vim/vim/commit/a9b579f3d7463720a316e11e77a7a9fbb9267986
Christian Brabandt <cb@256bit.org>
parents: 9560
diff changeset
75 int eval_isnamec1(int c);
21512
81c47a694479 patch 8.2.1306: checking for first character of dict key is inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 21220
diff changeset
76 int eval_isdictc(int c);
26990
4b8d836db103 patch 8.2.4024: confusing error message if imported name is used directly
Bram Moolenaar <Bram@vim.org>
parents: 26980
diff changeset
77 int handle_subscript(char_u **arg, char_u *name_start, typval_T *rettv, evalarg_T *evalarg, int verbose);
27517
f00a7a2bee21 patch 8.2.4286: Vim9: strict type checking after copy() and deepcopy()
Bram Moolenaar <Bram@vim.org>
parents: 27301
diff changeset
78 int item_copy(typval_T *from, typval_T *to, int deep, int top, int copyID);
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents: 18966
diff changeset
79 void echo_one(typval_T *rettv, int with_space, int *atstart, int *needclr);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
80 void ex_echo(exarg_T *eap);
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
81 void ex_echohl(exarg_T *eap);
17922
4d63d47d87ef patch 8.1.1957: more code can be moved to evalvars.c
Bram Moolenaar <Bram@vim.org>
parents: 17893
diff changeset
82 int get_echo_attr(void);
7668
21b0a39d13ed commit https://github.com/vim/vim/commit/ef26954a35207c3f17d6ed35d9a40c918d974892
Christian Brabandt <cb@256bit.org>
parents: 6935
diff changeset
83 void ex_execute(exarg_T *eap);
26441
65ab0b035dd8 patch 8.2.3751: cannot assign a lambda to an option that takes a function
Bram Moolenaar <Bram@vim.org>
parents: 26053
diff changeset
84 char_u *find_option_end(char_u **arg, int *scope);
14700
0a3b9ecf7cb8 patch 8.1.0362: cannot get the script line number when executing a function
Christian Brabandt <cb@256bit.org>
parents: 14439
diff changeset
85 void last_set_msg(sctx_T script_ctx);
9589
bf204ab1ce7d commit https://github.com/vim/vim/commit/72ab729c3dcdea0fba44d8e676602c847e841bcd
Christian Brabandt <cb@256bit.org>
parents: 9571
diff changeset
86 char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 /* vim: set ft=c : */