annotate src/vim9.h @ 29247:5f314b2ed494 v8.2.5142

patch 8.2.5142: startup test fails if there is a status bar Commit: https://github.com/vim/vim/commit/fa04eae5a5b9394079bde2d37ce6f9f8a5567d48 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 21 14:38:40 2022 +0100 patch 8.2.5142: startup test fails if there is a status bar Problem: Startup test fails if there is a status bar at the top of the screen. (Ernie Rael) Solution: Use a larger vertical offset in the test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Jun 2022 18:45:07 +0200
parents 11609f025219
children d269dd3cd31d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 *
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 *
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 * See README.txt for an overview of the Vim source code.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 */
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 /*
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 * vim9.h: types and globals used for Vim9 script.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 */
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
26662
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
14 #ifdef VMS
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
15 # include <float.h>
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
16 #endif
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
17
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 typedef enum {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 ISN_EXEC, // execute Ex command line isn_arg.string
20170
0612c64a2b87 patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents: 20142
diff changeset
20 ISN_EXECCONCAT, // execute Ex command from isn_arg.number items on stack
24826
a8d64f1a223b patch 8.2.2951: Vim9: cannot use heredoc for :python, :lua, etc.
Bram Moolenaar <Bram@vim.org>
parents: 24796
diff changeset
21 ISN_EXEC_SPLIT, // execute Ex command from isn_arg.string split at NL
26370
a3a0885d9dd8 patch 8.2.3716: Vim9: range without a command is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 26323
diff changeset
22 ISN_EXECRANGE, // execute EX command that is only a range
24645
668df21d8bc6 patch 8.2.2861: Vim9: "legacy return" is not recognized as a return statement
Bram Moolenaar <Bram@vim.org>
parents: 24606
diff changeset
23 ISN_LEGACY_EVAL, // evaluate expression isn_arg.string with legacy syntax.
25541
2ae1d5a4ae5c patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Bram Moolenaar <Bram@vim.org>
parents: 25533
diff changeset
24 ISN_ECHO, // :echo with isn_arg.echo.echo_count items on top of stack
2ae1d5a4ae5c patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Bram Moolenaar <Bram@vim.org>
parents: 25533
diff changeset
25 ISN_EXECUTE, // :execute with isn_arg.number items on top of stack
2ae1d5a4ae5c patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Bram Moolenaar <Bram@vim.org>
parents: 25533
diff changeset
26 ISN_ECHOMSG, // :echomsg with isn_arg.number items on top of stack
2ae1d5a4ae5c patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Bram Moolenaar <Bram@vim.org>
parents: 25533
diff changeset
27 ISN_ECHOCONSOLE, // :echoconsole with isn_arg.number items on top of stack
2ae1d5a4ae5c patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Bram Moolenaar <Bram@vim.org>
parents: 25533
diff changeset
28 ISN_ECHOERR, // :echoerr with isn_arg.number items on top of stack
23156
6aa8ddf7a3fa patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents: 22975
diff changeset
29 ISN_RANGE, // compute range from isn_arg.string, push to stack
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
30 ISN_SUBSTITUTE, // :s command with expression
28249
4b322951ebac patch 8.2.4650: "import autoload" only works with using 'runtimepath'
Bram Moolenaar <Bram@vim.org>
parents: 28226
diff changeset
31
4b322951ebac patch 8.2.4650: "import autoload" only works with using 'runtimepath'
Bram Moolenaar <Bram@vim.org>
parents: 28226
diff changeset
32 ISN_SOURCE, // source autoload script, isn_arg.number is the script ID
24606
a4fda40e0bb9 patch 8.2.2842: Vim9: skip argument to searchpair() is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
33 ISN_INSTR, // instructions compiled from expression
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 // get and set variables
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 ISN_LOAD, // push local variable isn_arg.number
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 ISN_LOADV, // push v: variable isn_arg.number
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
38 ISN_LOADG, // push g: variable isn_arg.string
23233
657216220293 patch 8.2.2162: Vim9: Cannot load or store autoload variables
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
39 ISN_LOADAUTO, // push g: autoload variable isn_arg.string
20089
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
40 ISN_LOADB, // push b: variable isn_arg.string
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
41 ISN_LOADW, // push w: variable isn_arg.string
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
42 ISN_LOADT, // push t: variable isn_arg.string
21399
5cb6e676defd patch 8.2.1250: Vim9: cannot use the g:, b:, t: and w: namespaces
Bram Moolenaar <Bram@vim.org>
parents: 21393
diff changeset
43 ISN_LOADGDICT, // push g: dict
5cb6e676defd patch 8.2.1250: Vim9: cannot use the g:, b:, t: and w: namespaces
Bram Moolenaar <Bram@vim.org>
parents: 21393
diff changeset
44 ISN_LOADBDICT, // push b: dict
5cb6e676defd patch 8.2.1250: Vim9: cannot use the g:, b:, t: and w: namespaces
Bram Moolenaar <Bram@vim.org>
parents: 21393
diff changeset
45 ISN_LOADWDICT, // push w: dict
5cb6e676defd patch 8.2.1250: Vim9: cannot use the g:, b:, t: and w: namespaces
Bram Moolenaar <Bram@vim.org>
parents: 21393
diff changeset
46 ISN_LOADTDICT, // push t: dict
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
47 ISN_LOADS, // push s: variable isn_arg.loadstore
28249
4b322951ebac patch 8.2.4650: "import autoload" only works with using 'runtimepath'
Bram Moolenaar <Bram@vim.org>
parents: 28226
diff changeset
48 ISN_LOADEXPORT, // push exported variable isn_arg.loadstore
23557
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
49 ISN_LOADOUTER, // push variable from outer scope isn_arg.outer
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 ISN_LOADSCRIPT, // push script-local variable isn_arg.script.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 ISN_LOADOPT, // push option isn_arg.string
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 ISN_LOADENV, // push environment variable isn_arg.string
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 ISN_LOADREG, // push register isn_arg.number
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 ISN_STORE, // pop into local variable isn_arg.number
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
56 ISN_STOREV, // pop into v: variable isn_arg.number
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 ISN_STOREG, // pop into global variable isn_arg.string
23233
657216220293 patch 8.2.2162: Vim9: Cannot load or store autoload variables
Bram Moolenaar <Bram@vim.org>
parents: 23229
diff changeset
58 ISN_STOREAUTO, // pop into global autoload variable isn_arg.string
20089
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
59 ISN_STOREB, // pop into buffer-local variable isn_arg.string
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
60 ISN_STOREW, // pop into window-local variable isn_arg.string
7fc5d62fe2a5 patch 8.2.0600: Vim9: cannot read or write w:, t: and b: variables
Bram Moolenaar <Bram@vim.org>
parents: 19964
diff changeset
61 ISN_STORET, // pop into tab-local variable isn_arg.string
19912
d4fa9db88d16 patch 8.2.0512: Vim9: no optional arguments in func type
Bram Moolenaar <Bram@vim.org>
parents: 19864
diff changeset
62 ISN_STORES, // pop into script variable isn_arg.loadstore
28249
4b322951ebac patch 8.2.4650: "import autoload" only works with using 'runtimepath'
Bram Moolenaar <Bram@vim.org>
parents: 28226
diff changeset
63 ISN_STOREEXPORT, // pop into exported script variable isn_arg.loadstore
23557
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
64 ISN_STOREOUTER, // pop variable into outer scope isn_arg.outer
19912
d4fa9db88d16 patch 8.2.0512: Vim9: no optional arguments in func type
Bram Moolenaar <Bram@vim.org>
parents: 19864
diff changeset
65 ISN_STORESCRIPT, // pop into script variable isn_arg.script
26470
ff0310e6f889 patch 8.2.3765: Vim9: cannot use a lambda for 'opfunc' and others
Bram Moolenaar <Bram@vim.org>
parents: 26370
diff changeset
66 ISN_STOREOPT, // pop into option isn_arg.storeopt
ff0310e6f889 patch 8.2.3765: Vim9: cannot use a lambda for 'opfunc' and others
Bram Moolenaar <Bram@vim.org>
parents: 26370
diff changeset
67 ISN_STOREFUNCOPT, // pop into option isn_arg.storeopt
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
68 ISN_STOREENV, // pop into environment variable isn_arg.string
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
69 ISN_STOREREG, // pop into register isn_arg.number
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 // ISN_STOREOTHER, // pop into other script variable isn_arg.other.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71
19597
1098989a90ee patch 8.2.0355: Vim9: str_val is confusing, it's a number
Bram Moolenaar <Bram@vim.org>
parents: 19566
diff changeset
72 ISN_STORENR, // store number into local variable isn_arg.storenr.stnr_idx
23266
00f7cd9b6033 patch 8.2.2179: Vim9: crash when indexing a dict with a number
Bram Moolenaar <Bram@vim.org>
parents: 23233
diff changeset
73 ISN_STOREINDEX, // store into list or dictionary, type isn_arg.vartype,
00f7cd9b6033 patch 8.2.2179: Vim9: crash when indexing a dict with a number
Bram Moolenaar <Bram@vim.org>
parents: 23233
diff changeset
74 // value/index/variable on stack
24434
602e528a8e43 patch 8.2.2757: Vim9: blob tests for legacy and Vim9 script are separate
Bram Moolenaar <Bram@vim.org>
parents: 24432
diff changeset
75 ISN_STORERANGE, // store into blob,
602e528a8e43 patch 8.2.2757: Vim9: blob tests for legacy and Vim9 script are separate
Bram Moolenaar <Bram@vim.org>
parents: 24432
diff changeset
76 // value/index 1/index 2/variable on stack
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77
20091
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
78 ISN_UNLET, // unlet variable isn_arg.unlet.ul_name
20099
058b41f85bcb patch 8.2.0605: Vim9: cannot unlet an environment variable
Bram Moolenaar <Bram@vim.org>
parents: 20091
diff changeset
79 ISN_UNLETENV, // unlet environment variable isn_arg.unlet.ul_name
23517
36bf9a6fbd4c patch 8.2.2301: Vim9: cannot unlet a dict or list item
Bram Moolenaar <Bram@vim.org>
parents: 23460
diff changeset
80 ISN_UNLETINDEX, // unlet item of list or dict
23982
9fcd71d0db89 patch 8.2.2533: Vim9: cannot use a range with :unlet
Bram Moolenaar <Bram@vim.org>
parents: 23970
diff changeset
81 ISN_UNLETRANGE, // unlet items of list
20091
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
82
25605
6f13d9ea0d04 patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents: 25541
diff changeset
83 ISN_LOCKUNLOCK, // :lock and :unlock for local variable member
22272
eb1f5f618c75 patch 8.2.1685: Vim9: cannot declare a constant value
Bram Moolenaar <Bram@vim.org>
parents: 22176
diff changeset
84 ISN_LOCKCONST, // lock constant value
eb1f5f618c75 patch 8.2.1685: Vim9: cannot declare a constant value
Bram Moolenaar <Bram@vim.org>
parents: 22176
diff changeset
85
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 // constants
19558
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
87 ISN_PUSHNR, // push number isn_arg.number
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
88 ISN_PUSHBOOL, // push bool value isn_arg.number
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
89 ISN_PUSHSPEC, // push special value isn_arg.number
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
90 ISN_PUSHF, // push float isn_arg.fnumber
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
91 ISN_PUSHS, // push string isn_arg.string
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
92 ISN_PUSHBLOB, // push blob isn_arg.blob
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
93 ISN_PUSHFUNC, // push func isn_arg.string
28156
088d8dc22045 patch 8.2.4602: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents: 28101
diff changeset
94 ISN_PUSHCHANNEL, // push NULL channel
088d8dc22045 patch 8.2.4602: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents: 28101
diff changeset
95 ISN_PUSHJOB, // push NULL job
19558
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
96 ISN_NEWLIST, // push list from stack items, size is isn_arg.number
28217
662d2d5db9a6 patch 8.2.4634: Vim9: cannot initialize a variable to null_list
Bram Moolenaar <Bram@vim.org>
parents: 28156
diff changeset
97 // -1 for null_list
19558
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
98 ISN_NEWDICT, // push dict from stack items, size is isn_arg.number
28217
662d2d5db9a6 patch 8.2.4634: Vim9: cannot initialize a variable to null_list
Bram Moolenaar <Bram@vim.org>
parents: 28156
diff changeset
99 // -1 for null_dict
28002
1012048eed26 patch 8.2.4526: Vim9: cannot set variables to a null value
Bram Moolenaar <Bram@vim.org>
parents: 27924
diff changeset
100 ISN_NEWPARTIAL, // push NULL partial
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101
27376
1a6421c5be20 patch 8.2.4216: Vim9: cannot use a function from an autoload import directly
Bram Moolenaar <Bram@vim.org>
parents: 27084
diff changeset
102 ISN_AUTOLOAD, // get item from autoload import, function or variable
1a6421c5be20 patch 8.2.4216: Vim9: cannot use a function from an autoload import directly
Bram Moolenaar <Bram@vim.org>
parents: 27084
diff changeset
103
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 // function call
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 ISN_BCALL, // call builtin function isn_arg.bfunc
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 ISN_DCALL, // call def function isn_arg.dfunc
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 ISN_UCALL, // call user function or funcref/partial isn_arg.ufunc
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 ISN_PCALL, // call partial, use isn_arg.pfunc
19862
846fbbacce3a patch 8.2.0487: Vim9: compiling not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19726
diff changeset
109 ISN_PCALL_END, // cleanup after ISN_PCALL with cpf_top set
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 ISN_RETURN, // return, result is on top of stack
24936
345619f35112 patch 8.2.3005: Vim9: using a void value does not give a proper error message
Bram Moolenaar <Bram@vim.org>
parents: 24918
diff changeset
111 ISN_RETURN_VOID, // Push void, then return
20247
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
112 ISN_FUNCREF, // push a function ref to dfunc isn_arg.funcref
21558
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
113 ISN_NEWFUNC, // create a global function from a lambda function
22973
4c97c0747017 patch 8.2.2033: Vim9: :def without argument gives compilation error
Bram Moolenaar <Bram@vim.org>
parents: 22703
diff changeset
114 ISN_DEF, // list functions
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 // expression operations
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 ISN_JUMP, // jump if condition is matched isn_arg.jump
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
118 ISN_JUMP_IF_ARG_SET, // jump if argument is already set, uses
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
119 // isn_arg.jumparg
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 // loop
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 ISN_FOR, // get next item from a list, uses isn_arg.forloop
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123
26672
3516017e5f54 patch 8.2.3865: Vim9: compiler complains about using "try" as a struct member
Bram Moolenaar <Bram@vim.org>
parents: 26662
diff changeset
124 ISN_TRY, // add entry to ec_trystack, uses isn_arg.tryref
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 ISN_THROW, // pop value of stack, store in v:exception
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 ISN_PUSHEXC, // push v:exception
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 ISN_CATCH, // drop v:exception
23994
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
128 ISN_FINALLY, // start of :finally block
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 ISN_ENDTRY, // take entry off from ec_trystack
28035
9f8535cf6f1b patch 8.2.4542: Vim9: "break" inside try/catch not handled correctly
Bram Moolenaar <Bram@vim.org>
parents: 28002
diff changeset
130 ISN_TRYCONT, // handle :continue or :break inside a :try statement
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131
21771
fcf978444298 patch 8.2.1435: Vim9: always converting to string for ".." leads to mistakes
Bram Moolenaar <Bram@vim.org>
parents: 21558
diff changeset
132 // more expression operations
22633
6589dae9696c patch 8.2.1865: Vim9: add() does not check type of argument
Bram Moolenaar <Bram@vim.org>
parents: 22494
diff changeset
133 ISN_ADDLIST, // add two lists
6589dae9696c patch 8.2.1865: Vim9: add() does not check type of argument
Bram Moolenaar <Bram@vim.org>
parents: 22494
diff changeset
134 ISN_ADDBLOB, // add two blobs
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135
23553
5c094273c015 patch 8.2.2319: "exptype_T" can be read as "expected type"
Bram Moolenaar <Bram@vim.org>
parents: 23543
diff changeset
136 // operation with two arguments; isn_arg.op.op_type is exprtype_T
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 ISN_OPNR,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 ISN_OPFLOAT,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 ISN_OPANY,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140
23553
5c094273c015 patch 8.2.2319: "exptype_T" can be read as "expected type"
Bram Moolenaar <Bram@vim.org>
parents: 23543
diff changeset
141 // comparative operations; isn_arg.op.op_type is exprtype_T, op_ic used
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 ISN_COMPAREBOOL,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 ISN_COMPARESPECIAL,
27924
e6e3abc28c7a patch 8.2.4487: Vim9: cannot compare with v:null
Bram Moolenaar <Bram@vim.org>
parents: 27698
diff changeset
144 ISN_COMPARENULL,
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 ISN_COMPARENR,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 ISN_COMPAREFLOAT,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 ISN_COMPARESTRING,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 ISN_COMPAREBLOB,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 ISN_COMPARELIST,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 ISN_COMPAREDICT,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 ISN_COMPAREFUNC,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 ISN_COMPAREANY,
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 // expression operations
28598
d550054e1328 patch 8.2.4823: concat more than 2 strings in :def function is inefficient
Bram Moolenaar <Bram@vim.org>
parents: 28249
diff changeset
155 ISN_CONCAT, // concatenate isn_arg.number strings
21393
320581a133d9 patch 8.2.1247: Vim9: cannot index a character in a string
Bram Moolenaar <Bram@vim.org>
parents: 21232
diff changeset
156 ISN_STRINDEX, // [expr] string index
21826
ccad66ac6c3e patch 8.2.1462: Vim9: string slice not supported yet
Bram Moolenaar <Bram@vim.org>
parents: 21771
diff changeset
157 ISN_STRSLICE, // [expr:expr] string slice
22633
6589dae9696c patch 8.2.1865: Vim9: add() does not check type of argument
Bram Moolenaar <Bram@vim.org>
parents: 22494
diff changeset
158 ISN_LISTAPPEND, // append to a list, like add()
21393
320581a133d9 patch 8.2.1247: Vim9: cannot index a character in a string
Bram Moolenaar <Bram@vim.org>
parents: 21232
diff changeset
159 ISN_LISTINDEX, // [expr] list index
21828
af5db9b6d210 patch 8.2.1463: Vim9: list slice not supported yet
Bram Moolenaar <Bram@vim.org>
parents: 21826
diff changeset
160 ISN_LISTSLICE, // [expr:expr] list slice
24432
aa150abca273 patch 8.2.2756: Vim9: blob index and slice not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 24272
diff changeset
161 ISN_BLOBINDEX, // [expr] blob index
aa150abca273 patch 8.2.2756: Vim9: blob index and slice not implemented yet
Bram Moolenaar <Bram@vim.org>
parents: 24272
diff changeset
162 ISN_BLOBSLICE, // [expr:expr] blob slice
21833
e3f9528bddda patch 8.2.1466: Vim9: cannot index or slice a variable with type "any"
Bram Moolenaar <Bram@vim.org>
parents: 21828
diff changeset
163 ISN_ANYINDEX, // [expr] runtime index
e3f9528bddda patch 8.2.1466: Vim9: cannot index or slice a variable with type "any"
Bram Moolenaar <Bram@vim.org>
parents: 21828
diff changeset
164 ISN_ANYSLICE, // [expr:expr] runtime slice
20871
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
165 ISN_SLICE, // drop isn_arg.number items from start of list
22637
4d4042683371 patch 8.2.1867: Vim9: argument to add() not checked for blob
Bram Moolenaar <Bram@vim.org>
parents: 22633
diff changeset
166 ISN_BLOBAPPEND, // append to a blob, like add()
20859
876e16c48bd1 patch 8.2.0981: Vim9: cannot compile "[var, var] = list"
Bram Moolenaar <Bram@vim.org>
parents: 20349
diff changeset
167 ISN_GETITEM, // push list item, isn_arg.number is the index
20349
e29b2ec8d4d2 patch 8.2.0730: Vim9: Assignment to dict member does not work
Bram Moolenaar <Bram@vim.org>
parents: 20295
diff changeset
168 ISN_MEMBER, // dict[member]
e29b2ec8d4d2 patch 8.2.0730: Vim9: Assignment to dict member does not work
Bram Moolenaar <Bram@vim.org>
parents: 20295
diff changeset
169 ISN_STRINGMEMBER, // dict.member using isn_arg.string
24796
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
170 ISN_2BOOL, // falsy/truthy to bool, uses isn_arg.tobool
22494
4c21f7f6f9e3 patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents: 22460
diff changeset
171 ISN_COND2BOOL, // convert value to bool
24796
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
172 ISN_2STRING, // convert value to string at isn_arg.tostring on stack
21771
fcf978444298 patch 8.2.1435: Vim9: always converting to string for ".." leads to mistakes
Bram Moolenaar <Bram@vim.org>
parents: 21558
diff changeset
173 ISN_2STRING_ANY, // like ISN_2STRING but check type
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 ISN_NEGATENR, // apply "-" to number
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175
23460
09868c86a97f patch 8.2.2273: build failure
Bram Moolenaar <Bram@vim.org>
parents: 23362
diff changeset
176 ISN_CHECKTYPE, // check value type is isn_arg.type.ct_type
20871
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
177 ISN_CHECKLEN, // check list length is isn_arg.checklen.cl_min_len
23460
09868c86a97f patch 8.2.2273: build failure
Bram Moolenaar <Bram@vim.org>
parents: 23362
diff changeset
178 ISN_SETTYPE, // set dict type to isn_arg.type.ct_type
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179
25800
fe8d153cb268 patch 8.2.3435: Vim9: dict is not passed to dict function
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
180 ISN_CLEARDICT, // clear dict saved by ISN_MEMBER/ISN_STRINGMEMBER
fe8d153cb268 patch 8.2.3435: Vim9: dict is not passed to dict function
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
181 ISN_USEDICT, // use or clear dict saved by ISN_MEMBER/ISN_STRINGMEMBER
fe8d153cb268 patch 8.2.3435: Vim9: dict is not passed to dict function
Bram Moolenaar <Bram@vim.org>
parents: 25719
diff changeset
182
22176
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
183 ISN_PUT, // ":put", uses isn_arg.put
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
184
22703
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
185 ISN_CMDMOD, // set cmdmod
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
186 ISN_CMDMOD_REV, // undo ISN_CMDMOD
22691
dda110a14be4 patch 8.2.1894: Vim9: command modifiers are not supported
Bram Moolenaar <Bram@vim.org>
parents: 22637
diff changeset
187
23717
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
188 ISN_PROF_START, // start a line for profiling
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
189 ISN_PROF_END, // end a line for profiling
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
190
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
191 ISN_DEBUG, // check for debug breakpoint, uses isn_arg.debug
24895
e61a2085c89b patch 8.2.2985: Vim9: a compiled function cannot be debugged
Bram Moolenaar <Bram@vim.org>
parents: 24826
diff changeset
192
22975
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
193 ISN_UNPACK, // unpack list into items, uses isn_arg.unpack
21232
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
194 ISN_SHUFFLE, // move item on stack up or down
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
195 ISN_DROP, // pop stack and discard value
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
196
24490
08050e45bd06 patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents: 24488
diff changeset
197 ISN_REDIRSTART, // :redir =>
08050e45bd06 patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents: 24488
diff changeset
198 ISN_REDIREND, // :redir END, isn_arg.number == 1 for append
08050e45bd06 patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents: 24488
diff changeset
199
24590
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
200 ISN_CEXPR_AUCMD, // first part of :cexpr isn_arg.number is cmdidx
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
201 ISN_CEXPR_CORE, // second part of :cexpr, uses isn_arg.cexpr
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
202
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
203 ISN_FINISH // end marker in list of instructions
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
204 } isntype_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
205
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
206
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 // arguments to ISN_BCALL
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
208 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
209 int cbf_idx; // index in "global_functions"
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210 int cbf_argcount; // number of arguments on top of stack
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
211 } cbfunc_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
213 // arguments to ISN_DCALL
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
214 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
215 int cdf_idx; // index in "def_functions" for ISN_DCALL
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
216 int cdf_argcount; // number of arguments on top of stack
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 } cdfunc_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
218
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
219 // arguments to ISN_PCALL
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 int cpf_top; // when TRUE partial is above the arguments
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
222 int cpf_argcount; // number of arguments on top of stack
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
223 } cpfunc_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
224
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
225 // arguments to ISN_UCALL and ISN_XCALL
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
226 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
227 char_u *cuf_name;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
228 int cuf_argcount; // number of arguments on top of stack
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
229 } cufunc_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
230
24984
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
231 // arguments to ISN_GETITEM
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
232 typedef struct {
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
233 varnumber_T gi_index;
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
234 int gi_with_op;
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
235 } getitem_T;
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
236
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
237 typedef enum {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
238 JUMP_ALWAYS,
25814
dd4e86558836 patch 8.2.3442: Vim9: || and && are not handled at compile time
Bram Moolenaar <Bram@vim.org>
parents: 25800
diff changeset
239 JUMP_NEVER,
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
240 JUMP_IF_FALSE, // pop and jump if false
22494
4c21f7f6f9e3 patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents: 22460
diff changeset
241 JUMP_AND_KEEP_IF_TRUE, // jump if top of stack is truthy, drop if not
4c21f7f6f9e3 patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents: 22460
diff changeset
242 JUMP_IF_COND_TRUE, // jump if top of stack is true, drop if not
4c21f7f6f9e3 patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents: 22460
diff changeset
243 JUMP_IF_COND_FALSE, // jump if top of stack is false, drop if not
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
244 } jumpwhen_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
245
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
246 // arguments to ISN_JUMP
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
247 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
248 jumpwhen_T jump_when;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
249 int jump_where; // position to jump to
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
250 } jump_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
251
24272
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
252 // arguments to ISN_JUMP_IF_ARG_SET
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
253 typedef struct {
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
254 int jump_arg_off; // argument index, negative
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
255 int jump_where; // position to jump to
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
256 } jumparg_T;
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
257
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
258 // arguments to ISN_FOR
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
259 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
260 int for_idx; // loop variable index
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
261 int for_end; // position to jump to after done
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
262 } forloop_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
263
23994
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
264 // indirect arguments to ISN_TRY
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
265 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
266 int try_catch; // position to jump to on throw
23927
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
267 int try_finally; // :finally or :endtry position to jump to
23994
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
268 int try_endtry; // :endtry position to jump to
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
269 } tryref_T;
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
270
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
271 // arguments to ISN_TRY
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
272 typedef struct {
3daeb2060f25 patch 8.2.2539: Vim9: return from finally block causes a hang
Bram Moolenaar <Bram@vim.org>
parents: 23982
diff changeset
273 tryref_T *try_ref;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
274 } try_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
275
23927
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
276 // arguments to ISN_TRYCONT
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
277 typedef struct {
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
278 int tct_levels; // number of nested try statements
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
279 int tct_where; // position to jump to, WHILE or FOR
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
280 } trycont_T;
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
281
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
282 // arguments to ISN_ECHO
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
283 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
284 int echo_with_white; // :echo instead of :echon
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
285 int echo_count; // number of expressions
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
286 } echo_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
287
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
288 // arguments to ISN_OPNR, ISN_OPFLOAT, etc.
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
289 typedef struct {
23553
5c094273c015 patch 8.2.2319: "exptype_T" can be read as "expected type"
Bram Moolenaar <Bram@vim.org>
parents: 23543
diff changeset
290 exprtype_T op_type;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
291 int op_ic; // TRUE with '#', FALSE with '?', else MAYBE
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
292 } opexpr_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
293
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
294 // arguments to ISN_CHECKTYPE
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
295 typedef struct {
22284
6b385c2b9ff5 patch 8.2.1691: Vim9: list<any> is not accepted where list<number> is expected
Bram Moolenaar <Bram@vim.org>
parents: 22272
diff changeset
296 type_T *ct_type;
23697
19073a768852 patch 8.2.2390: Vim9: using positive offset is unexpected
Bram Moolenaar <Bram@vim.org>
parents: 23695
diff changeset
297 int8_T ct_off; // offset in stack, -1 is bottom
19073a768852 patch 8.2.2390: Vim9: using positive offset is unexpected
Bram Moolenaar <Bram@vim.org>
parents: 23695
diff changeset
298 int8_T ct_arg_idx; // argument index or zero
28901
11609f025219 patch 8.2.4973: Vim9: type error for list unpack mentions argument
Bram Moolenaar <Bram@vim.org>
parents: 28809
diff changeset
299 int8_T ct_is_var; // when TRUE checking variable instead of arg
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
300 } checktype_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
301
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
302 // arguments to ISN_STORENR
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
303 typedef struct {
19597
1098989a90ee patch 8.2.0355: Vim9: str_val is confusing, it's a number
Bram Moolenaar <Bram@vim.org>
parents: 19566
diff changeset
304 int stnr_idx;
1098989a90ee patch 8.2.0355: Vim9: str_val is confusing, it's a number
Bram Moolenaar <Bram@vim.org>
parents: 19566
diff changeset
305 varnumber_T stnr_val;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
306 } storenr_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
307
26470
ff0310e6f889 patch 8.2.3765: Vim9: cannot use a lambda for 'opfunc' and others
Bram Moolenaar <Bram@vim.org>
parents: 26370
diff changeset
308 // arguments to ISN_STOREOPT and ISN_STOREFUNCOPT
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
309 typedef struct {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
310 char_u *so_name;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
311 int so_flags;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
312 } storeopt_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
313
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
314 // arguments to ISN_LOADS and ISN_STORES
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
315 typedef struct {
19912
d4fa9db88d16 patch 8.2.0512: Vim9: no optional arguments in func type
Bram Moolenaar <Bram@vim.org>
parents: 19864
diff changeset
316 char_u *ls_name; // variable name (with s: for ISN_STORES)
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
317 int ls_sid; // script ID
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
318 } loadstore_T;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
319
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
320 // arguments to ISN_LOADSCRIPT and ISN_STORESCRIPT
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
321 typedef struct {
23330
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
322 int sref_sid; // script ID
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
323 int sref_idx; // index in sn_var_vals
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
324 int sref_seq; // sn_script_seq when compiled
23362
f181fe2150ab patch 8.2.2224: Vim9: crash if script reloaded with different variable type
Bram Moolenaar <Bram@vim.org>
parents: 23330
diff changeset
325 type_T *sref_type; // type of the variable when compiled
23330
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
326 } scriptref_T;
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
327
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
328 typedef struct {
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
329 scriptref_T *scriptref;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
330 } script_T;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
331
20091
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
332 // arguments to ISN_UNLET
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
333 typedef struct {
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
334 char_u *ul_name; // variable name with g:, w:, etc.
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
335 int ul_forceit; // forceit flag
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
336 } unlet_T;
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
337
20247
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
338 // arguments to ISN_FUNCREF
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
339 typedef struct {
26323
3841da4eac23 patch 8.2.3692: Vim9: cannot use :func inside a :def function
Bram Moolenaar <Bram@vim.org>
parents: 25814
diff changeset
340 int fr_dfunc_idx; // function index for :def function
3841da4eac23 patch 8.2.3692: Vim9: cannot use :func inside a :def function
Bram Moolenaar <Bram@vim.org>
parents: 25814
diff changeset
341 char_u *fr_func_name; // function name for legacy function
20247
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
342 } funcref_T;
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
343
21558
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
344 // arguments to ISN_NEWFUNC
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
345 typedef struct {
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
346 char_u *nf_lambda; // name of the lambda already defined
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
347 char_u *nf_global; // name of the global function to be created
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
348 } newfunc_T;
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
349
20871
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
350 // arguments to ISN_CHECKLEN
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
351 typedef struct {
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
352 int cl_min_len; // minimum length
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
353 int cl_more_OK; // longer is allowed
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
354 } checklen_T;
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
355
21232
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
356 // arguments to ISN_SHUFFLE
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
357 typedef struct {
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
358 int shfl_item; // item to move (relative to top of stack)
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
359 int shfl_up; // places to move upwards
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
360 } shuffle_T;
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
361
22176
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
362 // arguments to ISN_PUT
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
363 typedef struct {
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
364 int put_regname; // register, can be NUL
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
365 linenr_T put_lnum; // line number to put below
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
366 } put_T;
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
367
22703
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
368 // arguments to ISN_CMDMOD
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
369 typedef struct {
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
370 cmdmod_T *cf_cmdmod; // allocated
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
371 } cmod_T;
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
372
22975
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
373 // arguments to ISN_UNPACK
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
374 typedef struct {
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
375 int unp_count; // number of items to produce
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
376 int unp_semicolon; // last item gets list of remainder
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
377 } unpack_T;
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
378
23557
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
379 // arguments to ISN_LOADOUTER and ISN_STOREOUTER
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
380 typedef struct {
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
381 int outer_idx; // index
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
382 int outer_depth; // nesting level, stack frames to go up
23559
64dfb69e7d46 patch 8.2.2322: Vim9: closure nested limiting to one level
Bram Moolenaar <Bram@vim.org>
parents: 23557
diff changeset
383 } isn_outer_T;
23557
f50ee1ae4d9b patch 8.2.2321: Vim9: cannot nest closures
Bram Moolenaar <Bram@vim.org>
parents: 23553
diff changeset
384
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
385 // arguments to ISN_SUBSTITUTE
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
386 typedef struct {
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
387 char_u *subs_cmd; // :s command
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
388 isn_T *subs_instr; // sequence of instructions
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
389 } subs_T;
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
390
24590
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
391 // indirect arguments to ISN_TRY
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
392 typedef struct {
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
393 int cer_cmdidx;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
394 char_u *cer_cmdline;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
395 int cer_forceit;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
396 } cexprref_T;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
397
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
398 // arguments to ISN_CEXPR_CORE
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
399 typedef struct {
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
400 cexprref_T *cexpr_ref;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
401 } cexpr_T;
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
402
24796
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
403 // arguments to ISN_2STRING and ISN_2STRING_ANY
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
404 typedef struct {
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
405 int offset;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
406 int tolerant;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
407 } tostring_T;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
408
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
409 // arguments to ISN_2BOOL
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
410 typedef struct {
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
411 int offset;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
412 int invert;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
413 } tobool_T;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
414
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
415 // arguments to ISN_DEBUG
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
416 typedef struct {
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
417 varnumber_T dbg_var_names_len; // current number of local variables
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
418 int dbg_break_lnum; // first line to break after
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
419 } debug_T;
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
420
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
421 /*
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
422 * Instruction
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
423 */
19726
ad37a198a708 patch 8.2.0419: various memory leaks in Vim9 script code
Bram Moolenaar <Bram@vim.org>
parents: 19597
diff changeset
424 struct isn_S {
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
425 isntype_T isn_type;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
426 int isn_lnum;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
427 union {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
428 char_u *string;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
429 varnumber_T number;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
430 blob_T *blob;
23266
00f7cd9b6033 patch 8.2.2179: Vim9: crash when indexing a dict with a number
Bram Moolenaar <Bram@vim.org>
parents: 23233
diff changeset
431 vartype_T vartype;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
432 #ifdef FEAT_FLOAT
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
433 float_T fnumber;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
434 #endif
19558
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
435 channel_T *channel;
8eeec8886c02 patch 8.2.0336: Vim9: insufficient test coverage for compiling
Bram Moolenaar <Bram@vim.org>
parents: 19528
diff changeset
436 job_T *job;
19566
ec1eeb1b69e2 patch 8.2.0340: Vim9: function and partial types not tested
Bram Moolenaar <Bram@vim.org>
parents: 19558
diff changeset
437 partial_T *partial;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
438 jump_T jump;
24272
cabed216cc2f patch 8.2.2677: Vim9: cannot use only some of the default arguments
Bram Moolenaar <Bram@vim.org>
parents: 24218
diff changeset
439 jumparg_T jumparg;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
440 forloop_T forloop;
26672
3516017e5f54 patch 8.2.3865: Vim9: compiler complains about using "try" as a struct member
Bram Moolenaar <Bram@vim.org>
parents: 26662
diff changeset
441 try_T tryref;
23927
5e5780e3f75d patch 8.2.2506: Vim9: :continue does not work correctly in a :try block
Bram Moolenaar <Bram@vim.org>
parents: 23738
diff changeset
442 trycont_T trycont;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
443 cbfunc_T bfunc;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
444 cdfunc_T dfunc;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
445 cpfunc_T pfunc;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
446 cufunc_T ufunc;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
447 echo_T echo;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
448 opexpr_T op;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
449 checktype_T type;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
450 storenr_T storenr;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
451 storeopt_T storeopt;
19283
9dc843109c97 patch 8.2.0200: Vim9 script commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19181
diff changeset
452 loadstore_T loadstore;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
453 script_T script;
20091
a64c16ff98b8 patch 8.2.0601: Vim9: :unlet is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 20089
diff changeset
454 unlet_T unlet;
20247
e46e72aaff74 patch 8.2.0679: Vim9: incomplete support for closures
Bram Moolenaar <Bram@vim.org>
parents: 20244
diff changeset
455 funcref_T funcref;
21558
1c4d4aa22b37 patch 8.2.1329: Vim9: cannot define global function inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21399
diff changeset
456 newfunc_T newfunc;
20871
65d9189d4dca patch 8.2.0987: Vim9: cannot assign to [var; var]
Bram Moolenaar <Bram@vim.org>
parents: 20859
diff changeset
457 checklen_T checklen;
21232
3f14e0d4a4dd patch 8.2.1167: Vim9: builtin function method call only supports first arg
Bram Moolenaar <Bram@vim.org>
parents: 20871
diff changeset
458 shuffle_T shuffle;
22176
6941d3205be9 patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents: 21833
diff changeset
459 put_T put;
22703
f2bfee4ac356 patch 8.2.1900: Vim9: command modifiers do not work
Bram Moolenaar <Bram@vim.org>
parents: 22691
diff changeset
460 cmod_T cmdmod;
22975
a943b175586a patch 8.2.2034: Vim9: list unpack in for statement not compiled yet
Bram Moolenaar <Bram@vim.org>
parents: 22973
diff changeset
461 unpack_T unpack;
23559
64dfb69e7d46 patch 8.2.2322: Vim9: closure nested limiting to one level
Bram Moolenaar <Bram@vim.org>
parents: 23557
diff changeset
462 isn_outer_T outer;
24488
f293bb501b30 patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents: 24434
diff changeset
463 subs_T subs;
24590
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24545
diff changeset
464 cexpr_T cexpr;
24606
a4fda40e0bb9 patch 8.2.2842: Vim9: skip argument to searchpair() is not compiled
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
465 isn_T *instr;
24796
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
466 tostring_T tostring;
7c1375eb1636 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset
Bram Moolenaar <Bram@vim.org>
parents: 24645
diff changeset
467 tobool_T tobool;
24984
71b1e2ef0069 patch 8.2.3029: Vim9: crash when using operator and list unpack assignment
Bram Moolenaar <Bram@vim.org>
parents: 24978
diff changeset
468 getitem_T getitem;
25004
70f55a30f03c patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Bram Moolenaar <Bram@vim.org>
parents: 24984
diff changeset
469 debug_T debug;
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
470 } isn_arg;
19726
ad37a198a708 patch 8.2.0419: various memory leaks in Vim9 script code
Bram Moolenaar <Bram@vim.org>
parents: 19597
diff changeset
471 };
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
472
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
473 /*
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
474 * Info about a function defined with :def. Used in "def_functions".
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
475 */
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
476 struct dfunc_S {
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
477 ufunc_T *df_ufunc; // struct containing most stuff
23285
112fa621b127 patch 8.2.2188: Vim9: crash when calling global function from :def function
Bram Moolenaar <Bram@vim.org>
parents: 23266
diff changeset
478 int df_refcount; // how many ufunc_T point to this dfunc_T
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
479 int df_idx; // index in def_functions
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
480 int df_deleted; // if TRUE function was deleted
23330
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
481 int df_script_seq; // Value of sctx_T sc_seq when the function
e8eb4fd44902 patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Bram Moolenaar <Bram@vim.org>
parents: 23285
diff changeset
482 // was compiled.
25533
df39041f13ed patch 8.2.3303: some structures could be smaller
Bram Moolenaar <Bram@vim.org>
parents: 25040
diff changeset
483 char_u *df_name; // name used for error messages
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
484
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
485 garray_T df_def_args_isn; // default argument instructions
24918
f11779c1d123 patch 8.2.2996: Vim9: when debugging cannot inspect local variables
Bram Moolenaar <Bram@vim.org>
parents: 24901
diff changeset
486 garray_T df_var_names; // names of local vars
23717
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
487
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
488 // After compiling "df_instr" and/or "df_instr_prof" is not NULL.
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
489 isn_T *df_instr; // function body to be executed
23717
e3720756acdc patch 8.2.2400: Vim9: compiled functions are not profiled
Bram Moolenaar <Bram@vim.org>
parents: 23697
diff changeset
490 int df_instr_count; // size of "df_instr"
25533
df39041f13ed patch 8.2.3303: some structures could be smaller
Bram Moolenaar <Bram@vim.org>
parents: 25040
diff changeset
491 int df_instr_debug_count; // size of "df_instr_debug"
df39041f13ed patch 8.2.3303: some structures could be smaller
Bram Moolenaar <Bram@vim.org>
parents: 25040
diff changeset
492 isn_T *df_instr_debug; // like "df_instr" with debugging
23719
1a7c2685d780 patch 8.2.2401: build fails without +profiling feature
Bram Moolenaar <Bram@vim.org>
parents: 23717
diff changeset
493 #ifdef FEAT_PROFILE
1a7c2685d780 patch 8.2.2401: build fails without +profiling feature
Bram Moolenaar <Bram@vim.org>
parents: 23717
diff changeset
494 isn_T *df_instr_prof; // like "df_instr" with profiling
1a7c2685d780 patch 8.2.2401: build fails without +profiling feature
Bram Moolenaar <Bram@vim.org>
parents: 23717
diff changeset
495 int df_instr_prof_count; // size of "df_instr_prof"
1a7c2685d780 patch 8.2.2401: build fails without +profiling feature
Bram Moolenaar <Bram@vim.org>
parents: 23717
diff changeset
496 #endif
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
497
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
498 int df_varcount; // number of local variables
22371
15003353a464 patch 8.2.1734: Vim9: cannot use a funcref for a closure twice
Bram Moolenaar <Bram@vim.org>
parents: 22284
diff changeset
499 int df_has_closure; // one if a closure was created
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
500 };
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
501
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
502 // Number of entries used by stack frame for a function call.
22460
4097509ecc1e patch 8.2.1778: Vim9: returning from a partial call clears outer context
Bram Moolenaar <Bram@vim.org>
parents: 22371
diff changeset
503 // - ec_dfunc_idx: function index
28809
d0241e74bfdb patch 8.2.4928: various white space and cosmetic mistakes
Bram Moolenaar <Bram@vim.org>
parents: 28625
diff changeset
504 // - ec_iidx: instruction index
24545
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
505 // - ec_instr: instruction list pointer
23559
64dfb69e7d46 patch 8.2.2322: Vim9: closure nested limiting to one level
Bram Moolenaar <Bram@vim.org>
parents: 23557
diff changeset
506 // - ec_outer: stack used for closures
24218
40e27d96e395 patch 8.2.2650: Vim9: command modifiers not handled in nested function
Bram Moolenaar <Bram@vim.org>
parents: 23994
diff changeset
507 // - funclocal: function-local data
22460
4097509ecc1e patch 8.2.1778: Vim9: returning from a partial call clears outer context
Bram Moolenaar <Bram@vim.org>
parents: 22371
diff changeset
508 // - ec_frame_idx: previous frame index
23559
64dfb69e7d46 patch 8.2.2322: Vim9: closure nested limiting to one level
Bram Moolenaar <Bram@vim.org>
parents: 23557
diff changeset
509 #define STACK_FRAME_FUNC_OFF 0
64dfb69e7d46 patch 8.2.2322: Vim9: closure nested limiting to one level
Bram Moolenaar <Bram@vim.org>
parents: 23557
diff changeset
510 #define STACK_FRAME_IIDX_OFF 1
24545
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
511 #define STACK_FRAME_INSTR_OFF 2
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
512 #define STACK_FRAME_OUTER_OFF 3
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
513 #define STACK_FRAME_FUNCLOCAL_OFF 4
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
514 #define STACK_FRAME_IDX_OFF 5
fe29b220eece patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents: 24490
diff changeset
515 #define STACK_FRAME_SIZE 6
19181
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
516
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
517
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
518 extern garray_T def_functions;
94eda51ba9ba patch 8.2.0149: maintaining a Vim9 branch separately is more work
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
519
23156
6aa8ddf7a3fa patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents: 22975
diff changeset
520 // Used for "lnum" when a range is to be taken from the stack.
28226
89c181c99e23 patch 8.2.4639: not sufficient parenthesis in preprocessor macros
Bram Moolenaar <Bram@vim.org>
parents: 28217
diff changeset
521 #define LNUM_VARIABLE_RANGE (-999)
23156
6aa8ddf7a3fa patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents: 22975
diff changeset
522
6aa8ddf7a3fa patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents: 22975
diff changeset
523 // Used for "lnum" when a range is to be taken from the stack and "!" is used.
28226
89c181c99e23 patch 8.2.4639: not sufficient parenthesis in preprocessor macros
Bram Moolenaar <Bram@vim.org>
parents: 28217
diff changeset
524 #define LNUM_VARIABLE_RANGE_ABOVE (-888)
23735
7caffd835aa1 patch 8.2.2409: Vim9: profiling only works for one function
Bram Moolenaar <Bram@vim.org>
parents: 23719
diff changeset
525
28101
3bc0a639dfb0 patch 8.2.4575: Vim9: test for profiling still fails
Bram Moolenaar <Bram@vim.org>
parents: 28035
diff changeset
526 // Keep in sync with get_compile_type()
23735
7caffd835aa1 patch 8.2.2409: Vim9: profiling only works for one function
Bram Moolenaar <Bram@vim.org>
parents: 23719
diff changeset
527 #ifdef FEAT_PROFILE
7caffd835aa1 patch 8.2.2409: Vim9: profiling only works for one function
Bram Moolenaar <Bram@vim.org>
parents: 23719
diff changeset
528 # define INSTRUCTIONS(dfunc) \
25719
154663508d9b patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Bram Moolenaar <Bram@vim.org>
parents: 25605
diff changeset
529 (debug_break_level > 0 || may_break_in_function(dfunc->df_ufunc) \
24901
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
530 ? (dfunc)->df_instr_debug \
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
531 : ((do_profiling == PROF_YES && (dfunc->df_ufunc)->uf_profiling) \
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
532 ? (dfunc)->df_instr_prof \
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
533 : (dfunc)->df_instr))
23735
7caffd835aa1 patch 8.2.2409: Vim9: profiling only works for one function
Bram Moolenaar <Bram@vim.org>
parents: 23719
diff changeset
534 #else
24901
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
535 # define INSTRUCTIONS(dfunc) \
28226
89c181c99e23 patch 8.2.4639: not sufficient parenthesis in preprocessor macros
Bram Moolenaar <Bram@vim.org>
parents: 28217
diff changeset
536 (debug_break_level > 0 || may_break_in_function((dfunc)->df_ufunc) \
24901
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
537 ? (dfunc)->df_instr_debug \
fd6e5c816654 patch 8.2.2988: Vim9: debugger test fails
Bram Moolenaar <Bram@vim.org>
parents: 24895
diff changeset
538 : (dfunc)->df_instr)
23735
7caffd835aa1 patch 8.2.2409: Vim9: profiling only works for one function
Bram Moolenaar <Bram@vim.org>
parents: 23719
diff changeset
539 #endif
26662
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
540
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
541 // Structure passed between the compile_expr* functions to keep track of
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
542 // constants that have been parsed but for which no code was produced yet. If
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
543 // possible expressions on these constants are applied at compile time. If
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
544 // that is not possible, the code to push the constants needs to be generated
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
545 // before other instructions.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
546 // Using 50 should be more than enough of 5 levels of ().
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
547 #define PPSIZE 50
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
548 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
549 typval_T pp_tv[PPSIZE]; // stack of ppconst constants
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
550 int pp_used; // active entries in pp_tv[]
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
551 int pp_is_const; // all generated code was constants, used for a
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
552 // list or dict with constant members
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
553 } ppconst_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
554
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
555 // values for ctx_skip
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
556 typedef enum {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
557 SKIP_NOT, // condition is a constant, produce code
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
558 SKIP_YES, // condition is a constant, do NOT produce code
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
559 SKIP_UNKNOWN // condition is not a constant, produce code
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
560 } skip_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
561
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
562 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
563 * Chain of jump instructions where the end label needs to be set.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
564 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
565 typedef struct endlabel_S endlabel_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
566 struct endlabel_S {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
567 endlabel_T *el_next; // chain end_label locations
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
568 int el_end_label; // instruction idx where to set end
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
569 };
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
570
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
571 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
572 * info specific for the scope of :if / elseif / else
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
573 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
574 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
575 int is_seen_else;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
576 int is_seen_skip_not; // a block was unconditionally executed
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
577 int is_had_return; // every block ends in :return
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
578 int is_if_label; // instruction idx at IF or ELSEIF
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
579 endlabel_T *is_end_label; // instructions to set end label
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
580 } ifscope_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
581
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
582 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
583 * info specific for the scope of :while
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
584 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
585 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
586 int ws_top_label; // instruction idx at WHILE
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
587 endlabel_T *ws_end_label; // instructions to set end
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
588 } whilescope_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
589
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
590 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
591 * info specific for the scope of :for
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
592 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
593 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
594 int fs_top_label; // instruction idx at FOR
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
595 endlabel_T *fs_end_label; // break instructions
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
596 } forscope_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
597
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
598 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
599 * info specific for the scope of :try
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
600 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
601 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
602 int ts_try_label; // instruction idx at TRY
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
603 endlabel_T *ts_end_label; // jump to :finally or :endtry
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
604 int ts_catch_label; // instruction idx of last CATCH
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
605 int ts_caught_all; // "catch" without argument encountered
27084
6fc63c6a7ee7 patch 8.2.4071: Vim9: no detection of return in try/endtry
Bram Moolenaar <Bram@vim.org>
parents: 26925
diff changeset
606 int ts_has_finally; // "finally" encountered
6fc63c6a7ee7 patch 8.2.4071: Vim9: no detection of return in try/endtry
Bram Moolenaar <Bram@vim.org>
parents: 26925
diff changeset
607 int ts_no_return; // one of the blocks did not end in return
26662
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
608 } tryscope_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
609
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
610 typedef enum {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
611 NO_SCOPE,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
612 IF_SCOPE,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
613 WHILE_SCOPE,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
614 FOR_SCOPE,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
615 TRY_SCOPE,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
616 BLOCK_SCOPE
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
617 } scopetype_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
618
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
619 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
620 * Info for one scope, pointed to by "ctx_scope".
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
621 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
622 typedef struct scope_S scope_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
623 struct scope_S {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
624 scope_T *se_outer; // scope containing this one
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
625 scopetype_T se_type;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
626 int se_local_count; // ctx_locals.ga_len before scope
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
627 skip_T se_skip_save; // ctx_skip before the block
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
628 union {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
629 ifscope_T se_if;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
630 whilescope_T se_while;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
631 forscope_T se_for;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
632 tryscope_T se_try;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
633 } se_u;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
634 };
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
635
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
636 /*
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
637 * Entry for "ctx_locals". Used for arguments and local variables.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
638 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
639 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
640 char_u *lv_name;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
641 type_T *lv_type;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
642 int lv_idx; // index of the variable on the stack
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
643 int lv_from_outer; // nesting level, using ctx_outer scope
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
644 int lv_const; // when TRUE cannot be assigned to
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
645 int lv_arg; // when TRUE this is an argument
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
646 } lvar_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
647
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
648 // Destination for an assignment or ":unlet" with an index.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
649 typedef enum {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
650 dest_local,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
651 dest_option,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
652 dest_func_option,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
653 dest_env,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
654 dest_global,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
655 dest_buffer,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
656 dest_window,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
657 dest_tab,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
658 dest_vimvar,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
659 dest_script,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
660 dest_reg,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
661 dest_expr,
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
662 } assign_dest_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
663
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
664 // Used by compile_lhs() to store information about the LHS of an assignment
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
665 // and one argument of ":unlet" with an index.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
666 typedef struct {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
667 assign_dest_T lhs_dest; // type of destination
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
668
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
669 char_u *lhs_name; // allocated name excluding the last
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
670 // "[expr]" or ".name".
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
671 size_t lhs_varlen; // length of the variable without
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
672 // "[expr]" or ".name"
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
673 char_u *lhs_whole; // allocated name including the last
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
674 // "[expr]" or ".name" for :redir
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
675 size_t lhs_varlen_total; // length of the variable including
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
676 // any "[expr]" or ".name"
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
677 char_u *lhs_dest_end; // end of the destination, including
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
678 // "[expr]" or ".name".
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
679 char_u *lhs_end; // end including any type
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
680
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
681 int lhs_has_index; // has "[expr]" or ".name"
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
682
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
683 int lhs_new_local; // create new local variable
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
684 int lhs_opt_flags; // for when destination is an option
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
685 int lhs_vimvaridx; // for when destination is a v:var
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
686
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
687 lvar_T lhs_local_lvar; // used for existing local destination
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
688 lvar_T lhs_arg_lvar; // used for argument destination
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
689 lvar_T *lhs_lvar; // points to destination lvar
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
690 int lhs_scriptvar_sid;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
691 int lhs_scriptvar_idx;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
692
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
693 int lhs_has_type; // type was specified
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
694 type_T *lhs_type;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
695 type_T *lhs_member_type;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
696
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
697 int lhs_append; // used by ISN_REDIREND
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
698 } lhs_T;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
699
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
700 /*
27698
3813036f19cb patch 8.2.4375: ctx_imports is not used
Bram Moolenaar <Bram@vim.org>
parents: 27376
diff changeset
701 * Context for compiling lines of a :def function.
26662
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
702 * Stores info about the local variables and condition stack.
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
703 */
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
704 struct cctx_S {
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
705 ufunc_T *ctx_ufunc; // current function
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
706 int ctx_lnum; // line number in current function
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
707 char_u *ctx_line_start; // start of current line or NULL
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
708 garray_T ctx_instr; // generated instructions
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
709
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
710 int ctx_prev_lnum; // line number below previous command, for
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
711 // debugging
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
712
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
713 compiletype_T ctx_compile_type;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
714
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
715 garray_T ctx_locals; // currently visible local variables
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
716
26771
fc859aea8cec patch 8.2.3914: various spelling mistakes in comments
Bram Moolenaar <Bram@vim.org>
parents: 26672
diff changeset
717 int ctx_has_closure; // set to one if a closure was created in
26662
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
718 // the function
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
719
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
720 skip_T ctx_skip;
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
721 scope_T *ctx_scope; // current scope, NULL at toplevel
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
722 int ctx_had_return; // last seen statement was "return"
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
723
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
724 cctx_T *ctx_outer; // outer scope for lambda or nested
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
725 // function
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
726 int ctx_outer_used; // var in ctx_outer was used
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
727
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
728 garray_T ctx_type_stack; // type of each item on the stack
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
729 garray_T *ctx_type_list; // list of pointers to allocated types
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
730
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
731 int ctx_has_cmdmod; // ISN_CMDMOD was generated
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
732
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
733 lhs_T ctx_redir_lhs; // LHS for ":redir => var", valid when
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
734 // lhs_name is not NULL
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
735 };
4b23672d1f0e patch 8.2.3860: Vim9: codecov struggles with the file size
Bram Moolenaar <Bram@vim.org>
parents: 26470
diff changeset
736
26925
4e77f9961650 patch 8.2.3991: Vim9: error when extending dict<any>
Bram Moolenaar <Bram@vim.org>
parents: 26771
diff changeset
737 // flags for typval2type()
4e77f9961650 patch 8.2.3991: Vim9: error when extending dict<any>
Bram Moolenaar <Bram@vim.org>
parents: 26771
diff changeset
738 #define TVTT_DO_MEMBER 1
4e77f9961650 patch 8.2.3991: Vim9: error when extending dict<any>
Bram Moolenaar <Bram@vim.org>
parents: 26771
diff changeset
739 #define TVTT_MORE_SPECIFIC 2 // get most specific type for member
4e77f9961650 patch 8.2.3991: Vim9: error when extending dict<any>
Bram Moolenaar <Bram@vim.org>
parents: 26771
diff changeset
740