Mercurial > vim
annotate src/proto/typval.pro @ 25338:e2be9f3c5907 v8.2.3206
patch 8.2.3206: Vim9: argument types are not checked at compile time
Commit: https://github.com/vim/vim/commit/0ad871dc4dfe1026e14931a55c225616b63f4c5b
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Jul 23 20:37:56 2021 +0200
patch 8.2.3206: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8611)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 23 Jul 2021 20:45:05 +0200 |
parents | 7e620652bd13 |
children | 75031a22be39 |
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); |
f502455965c0
patch 8.2.0847: typval related code is spread out
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 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
|
9 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
|
10 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
|
11 float_T tv_get_float(typval_T *varp); |
24246
35603c7991d7
patch 8.2.2664: Vim9: not enough function arguments checked for string
Bram Moolenaar <Bram@vim.org>
parents:
24210
diff
changeset
|
12 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
|
13 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
|
14 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
|
15 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
|
16 int check_for_opt_number_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
|
17 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
|
18 int check_for_opt_bool_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
|
19 int check_for_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
|
20 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
|
21 int check_for_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
|
22 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
|
23 int check_for_chan_or_job_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
|
24 int check_for_job_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
|
25 int check_for_string_or_number_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
|
26 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
|
27 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
|
28 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
|
29 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
|
30 int check_for_opt_string_or_number_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
|
31 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
|
32 int check_for_string_or_list_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
|
33 int check_for_list_or_blob_arg(typval_T *args, int idx); |
e2be9f3c5907
patch 8.2.3206: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
25314
diff
changeset
|
34 int check_for_list_or_dict_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
|
35 int check_for_buffer_or_dict_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
|
36 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
|
37 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
|
38 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
|
39 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
|
40 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
|
41 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
|
42 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
|
43 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
|
44 void copy_tv(typval_T *from, typval_T *to); |
23553
5c094273c015
patch 8.2.2319: "exptype_T" can be read as "expected type"
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
45 int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, int ic); |
23788
d12ef361d9de
patch 8.2.2435: setline() gives an error for some types
Bram Moolenaar <Bram@vim.org>
parents:
23786
diff
changeset
|
46 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
|
47 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
|
48 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
|
49 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
|
50 int eval_number(char_u **arg, typval_T *rettv, int evaluate, int want_string); |
4d844a65183d
patch 8.2.1111: inconsistent naming of get_list_tv() and eval_dict()
Bram Moolenaar <Bram@vim.org>
parents:
20587
diff
changeset
|
51 int eval_string(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
|
52 int eval_lit_string(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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 /* vim: set ft=c : */ |