Lines Matching refs:cctx
215 lookup_local(char_u *name, size_t len, lvar_T *lvar, cctx_T *cctx) in lookup_local() argument
224 for (idx = 0; idx < cctx->ctx_locals.ga_len; ++idx) in lookup_local()
226 lvp = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; in lookup_local()
240 if (cctx->ctx_outer != NULL) in lookup_local()
242 if (lookup_local(name, len, lvar, cctx->ctx_outer) == OK) in lookup_local()
246 cctx->ctx_outer_used = TRUE; in lookup_local()
270 cctx_T *cctx) in arg_exists() argument
277 for (idx = 0; idx < cctx->ctx_ufunc->uf_args_visible; ++idx) in arg_exists()
279 char_u *arg = FUNCARG(cctx->ctx_ufunc, idx); in arg_exists()
287 *idxp = idx - (cctx->ctx_ufunc->uf_args.ga_len in arg_exists()
289 + (cctx->ctx_ufunc->uf_va_name != NULL ? -1 : 0); in arg_exists()
291 if (cctx->ctx_ufunc->uf_arg_types != NULL) in arg_exists()
292 *type = cctx->ctx_ufunc->uf_arg_types[idx]; in arg_exists()
300 va_name = cctx->ctx_ufunc->uf_va_name; in arg_exists()
308 *type = cctx->ctx_ufunc->uf_va_type; in arg_exists()
313 if (cctx->ctx_outer != NULL) in arg_exists()
316 if (arg_exists(name, len, idxp, type, gen_load_outer, cctx->ctx_outer) in arg_exists()
336 find_script_var(char_u *name, size_t len, cctx_T *cctx) in find_script_var() argument
362 if (cctx == NULL) in find_script_var()
377 ufunc = cctx->ctx_ufunc; in find_script_var()
410 script_var_exists(char_u *name, size_t len, cctx_T *cctx) in script_var_exists() argument
418 if (find_script_var(name, len, cctx) != NULL) in script_var_exists()
444 variable_exists(char_u *name, size_t len, cctx_T *cctx) in variable_exists() argument
446 return (cctx != NULL in variable_exists()
447 && (lookup_local(name, len, NULL, cctx) == OK in variable_exists()
448 || arg_exists(name, len, NULL, NULL, NULL, cctx) == OK)) in variable_exists()
449 || script_var_exists(name, len, cctx) == OK in variable_exists()
450 || find_imported(name, len, cctx) != NULL; in variable_exists()
458 item_exists(char_u *name, size_t len, int cmd UNUSED, cctx_T *cctx) in item_exists() argument
463 if (variable_exists(name, len, cctx)) in item_exists()
478 return find_func(is_global ? name + 2 : name, is_global, cctx) != NULL; in item_exists()
491 check_defined(char_u *p, size_t len, cctx_T *cctx, int is_arg) in check_defined() argument
500 if (script_var_exists(p, len, cctx) == OK) in check_defined()
510 if ((cctx != NULL in check_defined()
511 && (lookup_local(p, len, NULL, cctx) == OK in check_defined()
512 || arg_exists(p, len, NULL, NULL, NULL, cctx) == OK)) in check_defined()
513 || find_imported(p, len, cctx) != NULL in check_defined()
514 || (ufunc = find_func_even_dead(p, FALSE, cctx)) != NULL) in check_defined()
537 #define RETURN_NULL_IF_SKIP(cctx) if (cctx->ctx_skip == SKIP_YES) return NULL argument
538 #define RETURN_OK_IF_SKIP(cctx) if (cctx->ctx_skip == SKIP_YES) return OK argument
545 generate_instr(cctx_T *cctx, isntype_T isn_type) in generate_instr() argument
547 garray_T *instr = &cctx->ctx_instr; in generate_instr()
550 RETURN_NULL_IF_SKIP(cctx); in generate_instr()
555 isn->isn_lnum = cctx->ctx_lnum + 1; in generate_instr()
567 generate_instr_drop(cctx_T *cctx, isntype_T isn_type, int drop) in generate_instr_drop() argument
569 garray_T *stack = &cctx->ctx_type_stack; in generate_instr_drop()
571 RETURN_NULL_IF_SKIP(cctx); in generate_instr_drop()
573 return generate_instr(cctx, isn_type); in generate_instr_drop()
580 generate_instr_type(cctx_T *cctx, isntype_T isn_type, type_T *type) in generate_instr_type() argument
583 garray_T *stack = &cctx->ctx_type_stack; in generate_instr_type()
585 if ((isn = generate_instr(cctx, isn_type)) == NULL) in generate_instr_type()
600 generate_instr_debug(cctx_T *cctx) in generate_instr_debug() argument
604 + cctx->ctx_ufunc->uf_dfunc_idx; in generate_instr_debug()
606 if ((isn = generate_instr(cctx, ISN_DEBUG)) == NULL) in generate_instr_debug()
609 isn->isn_arg.debug.dbg_break_lnum = cctx->ctx_prev_lnum; in generate_instr_debug()
619 may_generate_2STRING(int offset, int tolerant, cctx_T *cctx) in may_generate_2STRING() argument
623 garray_T *stack = &cctx->ctx_type_stack; in may_generate_2STRING()
626 RETURN_OK_IF_SKIP(cctx); in may_generate_2STRING()
669 if ((isn = generate_instr(cctx, isntype)) == NULL) in may_generate_2STRING()
698 cctx_T *cctx, in generate_add_instr() argument
704 garray_T *stack = &cctx->ctx_type_stack; in generate_add_instr()
705 isn_T *isn = generate_instr_drop(cctx, in generate_add_instr()
763 generate_two_op(cctx_T *cctx, char_u *op) in generate_two_op() argument
765 garray_T *stack = &cctx->ctx_type_stack; in generate_two_op()
771 RETURN_OK_IF_SKIP(cctx); in generate_two_op()
781 if (generate_add_instr(cctx, vartype, type1, type2, in generate_two_op()
792 isn = generate_instr_drop(cctx, ISN_OPNR, 1); in generate_two_op()
795 isn = generate_instr_drop(cctx, ISN_OPFLOAT, 1); in generate_two_op()
798 isn = generate_instr_drop(cctx, ISN_OPANY, 1); in generate_two_op()
812 isn = generate_instr_drop(cctx, in generate_two_op()
909 generate_COMPARE(cctx_T *cctx, exprtype_T exprtype, int ic) in generate_COMPARE() argument
913 garray_T *stack = &cctx->ctx_type_stack; in generate_COMPARE()
917 RETURN_OK_IF_SKIP(cctx); in generate_COMPARE()
928 if ((isn = generate_instr(cctx, isntype)) == NULL) in generate_COMPARE()
948 generate_2BOOL(cctx_T *cctx, int invert, int offset) in generate_2BOOL() argument
951 garray_T *stack = &cctx->ctx_type_stack; in generate_2BOOL()
953 RETURN_OK_IF_SKIP(cctx); in generate_2BOOL()
954 if ((isn = generate_instr(cctx, ISN_2BOOL)) == NULL) in generate_2BOOL()
969 generate_COND2BOOL(cctx_T *cctx) in generate_COND2BOOL() argument
972 garray_T *stack = &cctx->ctx_type_stack; in generate_COND2BOOL()
974 RETURN_OK_IF_SKIP(cctx); in generate_COND2BOOL()
975 if ((isn = generate_instr(cctx, ISN_COND2BOOL)) == NULL) in generate_COND2BOOL()
986 cctx_T *cctx, in generate_TYPECHECK() argument
992 garray_T *stack = &cctx->ctx_type_stack; in generate_TYPECHECK()
994 RETURN_OK_IF_SKIP(cctx); in generate_TYPECHECK()
995 if ((isn = generate_instr(cctx, ISN_CHECKTYPE)) == NULL) in generate_TYPECHECK()
1009 cctx_T *cctx, in generate_SETTYPE() argument
1014 RETURN_OK_IF_SKIP(cctx); in generate_SETTYPE()
1015 if ((isn = generate_instr(cctx, ISN_SETTYPE)) == NULL) in generate_SETTYPE()
1058 cctx_T *cctx, in need_type_where() argument
1067 generate_2BOOL(cctx, FALSE, offset); in need_type_where()
1079 generate_TYPECHECK(cctx, expected, offset, where.wt_index); in need_type_where()
1094 cctx_T *cctx, in need_type() argument
1102 cctx, silent, actual_is_const); in need_type()
1110 bool_on_stack(cctx_T *cctx) in bool_on_stack() argument
1112 garray_T *stack = &cctx->ctx_type_stack; in bool_on_stack()
1122 return generate_COND2BOOL(cctx); in bool_on_stack()
1124 return need_type(type, &t_bool, -1, 0, cctx, FALSE, FALSE); in bool_on_stack()
1131 generate_PUSHNR(cctx_T *cctx, varnumber_T number) in generate_PUSHNR() argument
1134 garray_T *stack = &cctx->ctx_type_stack; in generate_PUSHNR()
1136 RETURN_OK_IF_SKIP(cctx); in generate_PUSHNR()
1137 if ((isn = generate_instr_type(cctx, ISN_PUSHNR, &t_number)) == NULL) in generate_PUSHNR()
1151 generate_PUSHBOOL(cctx_T *cctx, varnumber_T number) in generate_PUSHBOOL() argument
1155 RETURN_OK_IF_SKIP(cctx); in generate_PUSHBOOL()
1156 if ((isn = generate_instr_type(cctx, ISN_PUSHBOOL, &t_bool)) == NULL) in generate_PUSHBOOL()
1167 generate_PUSHSPEC(cctx_T *cctx, varnumber_T number) in generate_PUSHSPEC() argument
1171 RETURN_OK_IF_SKIP(cctx); in generate_PUSHSPEC()
1172 if ((isn = generate_instr_type(cctx, ISN_PUSHSPEC, &t_special)) == NULL) in generate_PUSHSPEC()
1184 generate_PUSHF(cctx_T *cctx, float_T fnumber) in generate_PUSHF() argument
1188 RETURN_OK_IF_SKIP(cctx); in generate_PUSHF()
1189 if ((isn = generate_instr_type(cctx, ISN_PUSHF, &t_float)) == NULL) in generate_PUSHF()
1202 generate_PUSHS(cctx_T *cctx, char_u **str) in generate_PUSHS() argument
1206 if (cctx->ctx_skip == SKIP_YES) in generate_PUSHS()
1212 if ((isn = generate_instr_type(cctx, ISN_PUSHS, &t_string)) == NULL) in generate_PUSHS()
1228 generate_PUSHCHANNEL(cctx_T *cctx, channel_T *channel) in generate_PUSHCHANNEL() argument
1232 RETURN_OK_IF_SKIP(cctx); in generate_PUSHCHANNEL()
1233 if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL) in generate_PUSHCHANNEL()
1245 generate_PUSHJOB(cctx_T *cctx, job_T *job) in generate_PUSHJOB() argument
1249 RETURN_OK_IF_SKIP(cctx); in generate_PUSHJOB()
1250 if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_channel)) == NULL) in generate_PUSHJOB()
1262 generate_PUSHBLOB(cctx_T *cctx, blob_T *blob) in generate_PUSHBLOB() argument
1266 RETURN_OK_IF_SKIP(cctx); in generate_PUSHBLOB()
1267 if ((isn = generate_instr_type(cctx, ISN_PUSHBLOB, &t_blob)) == NULL) in generate_PUSHBLOB()
1279 generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type) in generate_PUSHFUNC() argument
1283 RETURN_OK_IF_SKIP(cctx); in generate_PUSHFUNC()
1284 if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, type)) == NULL) in generate_PUSHFUNC()
1297 generate_GETITEM(cctx_T *cctx, int index, int with_op) in generate_GETITEM() argument
1300 garray_T *stack = &cctx->ctx_type_stack; in generate_GETITEM()
1305 RETURN_OK_IF_SKIP(cctx); in generate_GETITEM()
1314 if ((isn = generate_instr(cctx, ISN_GETITEM)) == NULL) in generate_GETITEM()
1331 generate_SLICE(cctx_T *cctx, int count) in generate_SLICE() argument
1335 RETURN_OK_IF_SKIP(cctx); in generate_SLICE()
1336 if ((isn = generate_instr(cctx, ISN_SLICE)) == NULL) in generate_SLICE()
1346 generate_CHECKLEN(cctx_T *cctx, int min_len, int more_OK) in generate_CHECKLEN() argument
1350 RETURN_OK_IF_SKIP(cctx); in generate_CHECKLEN()
1352 if ((isn = generate_instr(cctx, ISN_CHECKLEN)) == NULL) in generate_CHECKLEN()
1364 generate_STORE(cctx_T *cctx, isntype_T isn_type, int idx, char_u *name) in generate_STORE() argument
1368 RETURN_OK_IF_SKIP(cctx); in generate_STORE()
1369 if ((isn = generate_instr_drop(cctx, isn_type, 1)) == NULL) in generate_STORE()
1383 generate_STOREOUTER(cctx_T *cctx, int idx, int level) in generate_STOREOUTER() argument
1387 RETURN_OK_IF_SKIP(cctx); in generate_STOREOUTER()
1388 if ((isn = generate_instr_drop(cctx, ISN_STOREOUTER, 1)) == NULL) in generate_STOREOUTER()
1400 generate_STORENR(cctx_T *cctx, int idx, varnumber_T value) in generate_STORENR() argument
1404 RETURN_OK_IF_SKIP(cctx); in generate_STORENR()
1405 if ((isn = generate_instr(cctx, ISN_STORENR)) == NULL) in generate_STORENR()
1417 generate_STOREOPT(cctx_T *cctx, char_u *name, int opt_flags) in generate_STOREOPT() argument
1421 RETURN_OK_IF_SKIP(cctx); in generate_STOREOPT()
1422 if ((isn = generate_instr_drop(cctx, ISN_STOREOPT, 1)) == NULL) in generate_STOREOPT()
1435 cctx_T *cctx, in generate_LOAD() argument
1443 RETURN_OK_IF_SKIP(cctx); in generate_LOAD()
1444 if ((isn = generate_instr_type(cctx, isn_type, type)) == NULL) in generate_LOAD()
1459 cctx_T *cctx, in generate_LOADOUTER() argument
1466 RETURN_OK_IF_SKIP(cctx); in generate_LOADOUTER()
1467 if ((isn = generate_instr_type(cctx, ISN_LOADOUTER, type)) == NULL) in generate_LOADOUTER()
1480 cctx_T *cctx, in generate_LOADV() argument
1488 RETURN_OK_IF_SKIP(cctx); in generate_LOADV()
1495 type = typval2type_vimvar(get_vim_var_tv(vidx), cctx->ctx_type_list); in generate_LOADV()
1497 return generate_LOAD(cctx, ISN_LOADV, vidx, NULL, type); in generate_LOADV()
1504 generate_UNLET(cctx_T *cctx, isntype_T isn_type, char_u *name, int forceit) in generate_UNLET() argument
1508 RETURN_OK_IF_SKIP(cctx); in generate_UNLET()
1509 if ((isn = generate_instr(cctx, isn_type)) == NULL) in generate_UNLET()
1521 generate_LOCKCONST(cctx_T *cctx) in generate_LOCKCONST() argument
1525 RETURN_OK_IF_SKIP(cctx); in generate_LOCKCONST()
1526 if ((isn = generate_instr(cctx, ISN_LOCKCONST)) == NULL) in generate_LOCKCONST()
1536 cctx_T *cctx, in generate_OLDSCRIPT() argument
1544 RETURN_OK_IF_SKIP(cctx); in generate_OLDSCRIPT()
1546 isn = generate_instr_type(cctx, isn_type, type); in generate_OLDSCRIPT()
1548 isn = generate_instr_drop(cctx, isn_type, 1); in generate_OLDSCRIPT()
1562 cctx_T *cctx, in generate_VIM9SCRIPT() argument
1572 RETURN_OK_IF_SKIP(cctx); in generate_VIM9SCRIPT()
1574 isn = generate_instr_type(cctx, isn_type, type); in generate_VIM9SCRIPT()
1576 isn = generate_instr_drop(cctx, isn_type, 1); in generate_VIM9SCRIPT()
1597 generate_NEWLIST(cctx_T *cctx, int count) in generate_NEWLIST() argument
1600 garray_T *stack = &cctx->ctx_type_stack; in generate_NEWLIST()
1604 RETURN_OK_IF_SKIP(cctx); in generate_NEWLIST()
1605 if ((isn = generate_instr(cctx, ISN_NEWLIST)) == NULL) in generate_NEWLIST()
1615 cctx->ctx_type_list); in generate_NEWLIST()
1616 type = get_list_type(member, cctx->ctx_type_list); in generate_NEWLIST()
1634 generate_NEWDICT(cctx_T *cctx, int count) in generate_NEWDICT() argument
1637 garray_T *stack = &cctx->ctx_type_stack; in generate_NEWDICT()
1641 RETURN_OK_IF_SKIP(cctx); in generate_NEWDICT()
1642 if ((isn = generate_instr(cctx, ISN_NEWDICT)) == NULL) in generate_NEWDICT()
1651 cctx->ctx_type_list); in generate_NEWDICT()
1652 type = get_dict_type(member, cctx->ctx_type_list); in generate_NEWDICT()
1670 generate_FUNCREF(cctx_T *cctx, ufunc_T *ufunc) in generate_FUNCREF() argument
1673 garray_T *stack = &cctx->ctx_type_stack; in generate_FUNCREF()
1675 RETURN_OK_IF_SKIP(cctx); in generate_FUNCREF()
1676 if ((isn = generate_instr(cctx, ISN_FUNCREF)) == NULL) in generate_FUNCREF()
1679 cctx->ctx_has_closure = 1; in generate_FUNCREF()
1684 cctx->ctx_ufunc->uf_flags |= FC_CLOSURE; in generate_FUNCREF()
1701 generate_NEWFUNC(cctx_T *cctx, char_u *lambda_name, char_u *func_name) in generate_NEWFUNC() argument
1705 if (cctx->ctx_skip == SKIP_YES) in generate_NEWFUNC()
1711 if ((isn = generate_instr(cctx, ISN_NEWFUNC)) == NULL) in generate_NEWFUNC()
1727 generate_DEF(cctx_T *cctx, char_u *name, size_t len) in generate_DEF() argument
1731 RETURN_OK_IF_SKIP(cctx); in generate_DEF()
1732 if ((isn = generate_instr(cctx, ISN_DEF)) == NULL) in generate_DEF()
1747 generate_JUMP(cctx_T *cctx, jumpwhen_T when, int where) in generate_JUMP() argument
1750 garray_T *stack = &cctx->ctx_type_stack; in generate_JUMP()
1752 RETURN_OK_IF_SKIP(cctx); in generate_JUMP()
1753 if ((isn = generate_instr(cctx, ISN_JUMP)) == NULL) in generate_JUMP()
1768 generate_JUMP_IF_ARG_SET(cctx_T *cctx, int arg_off) in generate_JUMP_IF_ARG_SET() argument
1772 RETURN_OK_IF_SKIP(cctx); in generate_JUMP_IF_ARG_SET()
1773 if ((isn = generate_instr(cctx, ISN_JUMP_IF_ARG_SET)) == NULL) in generate_JUMP_IF_ARG_SET()
1781 generate_FOR(cctx_T *cctx, int loop_idx) in generate_FOR() argument
1784 garray_T *stack = &cctx->ctx_type_stack; in generate_FOR()
1786 RETURN_OK_IF_SKIP(cctx); in generate_FOR()
1787 if ((isn = generate_instr(cctx, ISN_FOR)) == NULL) in generate_FOR()
1803 generate_TRYCONT(cctx_T *cctx, int levels, int where) in generate_TRYCONT() argument
1807 RETURN_OK_IF_SKIP(cctx); in generate_TRYCONT()
1808 if ((isn = generate_instr(cctx, ISN_TRYCONT)) == NULL) in generate_TRYCONT()
1823 generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call) in generate_BCALL() argument
1826 garray_T *stack = &cctx->ctx_type_stack; in generate_BCALL()
1832 RETURN_OK_IF_SKIP(cctx); in generate_BCALL()
1839 if ((isn = generate_instr(cctx, ISN_SHUFFLE)) == NULL) in generate_BCALL()
1860 cctx) == FAIL) in generate_BCALL()
1866 if ((isn = generate_instr(cctx, ISN_BCALL)) == NULL) in generate_BCALL()
1882 generate_TYPECHECK(cctx, maptype, -1, 1); in generate_BCALL()
1892 generate_LISTAPPEND(cctx_T *cctx) in generate_LISTAPPEND() argument
1894 garray_T *stack = &cctx->ctx_type_stack; in generate_LISTAPPEND()
1903 if (need_type(item_type, expected, -1, 0, cctx, FALSE, FALSE) == FAIL) in generate_LISTAPPEND()
1906 if (generate_instr(cctx, ISN_LISTAPPEND) == NULL) in generate_LISTAPPEND()
1918 generate_BLOBAPPEND(cctx_T *cctx) in generate_BLOBAPPEND() argument
1920 garray_T *stack = &cctx->ctx_type_stack; in generate_BLOBAPPEND()
1925 if (need_type(item_type, &t_number, -1, 0, cctx, FALSE, FALSE) == FAIL) in generate_BLOBAPPEND()
1928 if (generate_instr(cctx, ISN_BLOBAPPEND) == NULL) in generate_BLOBAPPEND()
1978 generate_CALL(cctx_T *cctx, ufunc_T *ufunc, int pushed_argcount) in generate_CALL() argument
1981 garray_T *stack = &cctx->ctx_type_stack; in generate_CALL()
1985 RETURN_OK_IF_SKIP(cctx); in generate_CALL()
2026 if (need_type(actual, expected, -argcount + i, i + 1, cctx, in generate_CALL()
2045 if ((isn = generate_instr(cctx, in generate_CALL()
2076 generate_UCALL(cctx_T *cctx, char_u *name, int argcount) in generate_UCALL() argument
2079 garray_T *stack = &cctx->ctx_type_stack; in generate_UCALL()
2081 RETURN_OK_IF_SKIP(cctx); in generate_UCALL()
2082 if ((isn = generate_instr(cctx, ISN_UCALL)) == NULL) in generate_UCALL()
2103 cctx_T *cctx, in generate_PCALL() argument
2110 garray_T *stack = &cctx->ctx_type_stack; in generate_PCALL()
2113 RETURN_OK_IF_SKIP(cctx); in generate_PCALL()
2153 cctx, TRUE, FALSE) == FAIL) in generate_PCALL()
2172 if ((isn = generate_instr(cctx, ISN_PCALL)) == NULL) in generate_PCALL()
2184 if (at_top && generate_instr(cctx, ISN_PCALL_END) == NULL) in generate_PCALL()
2194 generate_STRINGMEMBER(cctx_T *cctx, char_u *name, size_t len) in generate_STRINGMEMBER() argument
2197 garray_T *stack = &cctx->ctx_type_stack; in generate_STRINGMEMBER()
2200 RETURN_OK_IF_SKIP(cctx); in generate_STRINGMEMBER()
2201 if ((isn = generate_instr(cctx, ISN_STRINGMEMBER)) == NULL) in generate_STRINGMEMBER()
2230 generate_ECHO(cctx_T *cctx, int with_white, int count) in generate_ECHO() argument
2234 RETURN_OK_IF_SKIP(cctx); in generate_ECHO()
2235 if ((isn = generate_instr_drop(cctx, ISN_ECHO, count)) == NULL) in generate_ECHO()
2247 generate_MULT_EXPR(cctx_T *cctx, isntype_T isn_type, int count) in generate_MULT_EXPR() argument
2251 if ((isn = generate_instr_drop(cctx, isn_type, count)) == NULL) in generate_MULT_EXPR()
2262 generate_PUT(cctx_T *cctx, int regname, linenr_T lnum) in generate_PUT() argument
2266 RETURN_OK_IF_SKIP(cctx); in generate_PUT()
2267 if ((isn = generate_instr(cctx, ISN_PUT)) == NULL) in generate_PUT()
2275 generate_EXEC(cctx_T *cctx, isntype_T isntype, char_u *line) in generate_EXEC() argument
2279 RETURN_OK_IF_SKIP(cctx); in generate_EXEC()
2280 if ((isn = generate_instr(cctx, isntype)) == NULL) in generate_EXEC()
2287 generate_LEGACY_EVAL(cctx_T *cctx, char_u *line) in generate_LEGACY_EVAL() argument
2290 garray_T *stack = &cctx->ctx_type_stack; in generate_LEGACY_EVAL()
2292 RETURN_OK_IF_SKIP(cctx); in generate_LEGACY_EVAL()
2293 if ((isn = generate_instr(cctx, ISN_LEGACY_EVAL)) == NULL) in generate_LEGACY_EVAL()
2306 generate_EXECCONCAT(cctx_T *cctx, int count) in generate_EXECCONCAT() argument
2310 if ((isn = generate_instr_drop(cctx, ISN_EXECCONCAT, count)) == NULL) in generate_EXECCONCAT()
2320 generate_RANGE(cctx_T *cctx, char_u *range) in generate_RANGE() argument
2323 garray_T *stack = &cctx->ctx_type_stack; in generate_RANGE()
2325 if ((isn = generate_instr(cctx, ISN_RANGE)) == NULL) in generate_RANGE()
2337 generate_UNPACK(cctx_T *cctx, int var_count, int semicolon) in generate_UNPACK() argument
2341 RETURN_OK_IF_SKIP(cctx); in generate_UNPACK()
2342 if ((isn = generate_instr(cctx, ISN_UNPACK)) == NULL) in generate_UNPACK()
2353 generate_cmdmods(cctx_T *cctx, cmdmod_T *cmod) in generate_cmdmods() argument
2359 cctx->ctx_has_cmdmod = TRUE; in generate_cmdmods()
2361 if ((isn = generate_instr(cctx, ISN_CMDMOD)) == NULL) in generate_cmdmods()
2375 generate_undo_cmdmods(cctx_T *cctx) in generate_undo_cmdmods() argument
2377 if (cctx->ctx_has_cmdmod && generate_instr(cctx, ISN_CMDMOD_REV) == NULL) in generate_undo_cmdmods()
2379 cctx->ctx_has_cmdmod = FALSE; in generate_undo_cmdmods()
2384 misplaced_cmdmod(cctx_T *cctx) in misplaced_cmdmod() argument
2386 garray_T *instr = &cctx->ctx_instr; in misplaced_cmdmod()
2388 if (cctx->ctx_has_cmdmod in misplaced_cmdmod()
2403 current_instr_idx(cctx_T *cctx) in current_instr_idx() argument
2405 garray_T *instr = &cctx->ctx_instr; in current_instr_idx()
2410 if (cctx->ctx_has_cmdmod && ((isn_T *)instr->ga_data)[idx - 1] in current_instr_idx()
2435 may_generate_prof_end(cctx_T *cctx, int prof_lnum) in may_generate_prof_end() argument
2437 if (cctx->ctx_compile_type == CT_PROFILE && prof_lnum >= 0) in may_generate_prof_end()
2438 generate_instr(cctx, ISN_PROF_END); in may_generate_prof_end()
2448 cctx_T *cctx, in reserve_local() argument
2457 if (arg_exists(name, len, NULL, NULL, NULL, cctx) == OK) in reserve_local()
2463 if (GA_GROW_FAILS(&cctx->ctx_locals, 1)) in reserve_local()
2465 lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + cctx->ctx_locals.ga_len++; in reserve_local()
2472 dfunc = ((dfunc_T *)def_functions.ga_data) + cctx->ctx_ufunc->uf_dfunc_idx; in reserve_local()
2493 unwind_locals(cctx_T *cctx, int new_top) in unwind_locals() argument
2495 if (cctx->ctx_locals.ga_len > new_top) in unwind_locals()
2500 for (idx = new_top; idx < cctx->ctx_locals.ga_len; ++idx) in unwind_locals()
2502 lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; in unwind_locals()
2506 cctx->ctx_locals.ga_len = new_top; in unwind_locals()
2513 free_locals(cctx_T *cctx) in free_locals() argument
2515 unwind_locals(cctx, 0); in free_locals()
2516 ga_clear(&cctx->ctx_locals); in free_locals()
2545 get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx) in get_script_item_idx() argument
2557 sallvar_T *sav = find_script_var(name, 0, cctx); in get_script_item_idx()
2593 find_imported(char_u *name, size_t len, cctx_T *cctx) in find_imported() argument
2599 if (cctx != NULL) in find_imported()
2600 for (idx = 0; idx < cctx->ctx_imports.ga_len; ++idx) in find_imported()
2602 imported_T *import = ((imported_T *)cctx->ctx_imports.ga_data) in find_imported()
2639 free_imported(cctx_T *cctx) in free_imported() argument
2643 for (idx = 0; idx < cctx->ctx_imports.ga_len; ++idx) in free_imported()
2645 imported_T *import = ((imported_T *)cctx->ctx_imports.ga_data) + idx; in free_imported()
2649 ga_clear(&cctx->ctx_imports); in free_imported()
2658 peek_next_line_from_context(cctx_T *cctx) in peek_next_line_from_context() argument
2660 int lnum = cctx->ctx_lnum; in peek_next_line_from_context()
2662 while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len) in peek_next_line_from_context()
2664 char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum]; in peek_next_line_from_context()
2687 may_peek_next_line(cctx_T *cctx, char_u *arg, char_u **nextp) in may_peek_next_line() argument
2694 *nextp = peek_next_line_from_context(cctx); in may_peek_next_line()
2707 next_line_from_context(cctx_T *cctx, int skip_comment) in next_line_from_context() argument
2713 ++cctx->ctx_lnum; in next_line_from_context()
2714 if (cctx->ctx_lnum >= cctx->ctx_ufunc->uf_lines.ga_len) in next_line_from_context()
2719 line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum]; in next_line_from_context()
2720 cctx->ctx_line_start = line; in next_line_from_context()
2721 SOURCING_LNUM = cctx->ctx_lnum + 1; in next_line_from_context()
2734 may_get_next_line(char_u *whitep, char_u **arg, cctx_T *cctx) in may_get_next_line() argument
2741 char_u *next = next_line_from_context(cctx, TRUE); in may_get_next_line()
2754 may_get_next_line_error(char_u *whitep, char_u **arg, cctx_T *cctx) in may_get_next_line_error() argument
2756 if (may_get_next_line(whitep, arg, cctx) == FAIL) in may_get_next_line_error()
2758 SOURCING_LNUM = cctx->ctx_lnum + 1; in may_get_next_line_error()
2780 static int compile_expr0_ext(char_u **arg, cctx_T *cctx, int *is_const);
2781 static int compile_expr0(char_u **arg, cctx_T *cctx);
2782 static int compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst);
2790 generate_tv_PUSH(cctx_T *cctx, typval_T *tv) in generate_tv_PUSH() argument
2799 generate_PUSHBOOL(cctx, tv->vval.v_number); in generate_tv_PUSH()
2802 generate_PUSHSPEC(cctx, tv->vval.v_number); in generate_tv_PUSH()
2805 generate_PUSHNR(cctx, tv->vval.v_number); in generate_tv_PUSH()
2809 generate_PUSHF(cctx, tv->vval.v_float); in generate_tv_PUSH()
2813 generate_PUSHBLOB(cctx, tv->vval.v_blob); in generate_tv_PUSH()
2817 generate_PUSHS(cctx, &tv->vval.v_string); in generate_tv_PUSH()
2834 generate_ppconst(cctx_T *cctx, ppconst_T *ppconst) in generate_ppconst() argument
2838 int save_skip = cctx->ctx_skip; in generate_ppconst()
2840 cctx->ctx_skip = SKIP_NOT; in generate_ppconst()
2842 if (generate_tv_PUSH(cctx, &ppconst->pp_tv[i]) == FAIL) in generate_ppconst()
2845 cctx->ctx_skip = save_skip; in generate_ppconst()
2884 compile_member(int is_slice, int *keeping_dict, cctx_T *cctx) in compile_member() argument
2887 garray_T *stack = &cctx->ctx_type_stack; in compile_member()
2903 if (need_type(idxtype, &t_number, -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_member()
2908 if (need_type(idxtype, &t_number, -2, 0, cctx, in compile_member()
2930 if (need_type(*typep, &t_dict_any, -2, 0, cctx, in compile_member()
2935 if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_member()
2937 if (generate_instr_drop(cctx, ISN_MEMBER, 1) == FAIL) in compile_member()
2946 ? generate_instr_drop(cctx, ISN_STRSLICE, 2) in compile_member()
2947 : generate_instr_drop(cctx, ISN_STRINDEX, 1)) == FAIL) in compile_member()
2955 if (generate_instr_drop(cctx, ISN_BLOBSLICE, 2) == FAIL) in compile_member()
2961 if (generate_instr_drop(cctx, ISN_BLOBINDEX, 1) == FAIL) in compile_member()
2969 if (generate_instr_drop(cctx, in compile_member()
2983 if (generate_instr_drop(cctx, in compile_member()
3004 cctx_T *cctx, in compile_load_scriptvar() argument
3017 idx = get_script_item_idx(current_sctx.sc_sid, name, 0, cctx); in compile_load_scriptvar()
3021 return generate_OLDSCRIPT(cctx, ISN_LOADS, name, current_sctx.sc_sid, in compile_load_scriptvar()
3028 generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT, in compile_load_scriptvar()
3033 import = find_imported(name, 0, cctx); in compile_load_scriptvar()
3065 cctx, TRUE); in compile_load_scriptvar()
3074 generate_PUSHFUNC(cctx, ufunc->uf_name, import->imp_type); in compile_load_scriptvar()
3080 generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT, in compile_load_scriptvar()
3086 generate_PUSHFUNC(cctx, import->imp_funcname, import->imp_type); in compile_load_scriptvar()
3088 generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT, in compile_load_scriptvar()
3101 generate_funcref(cctx_T *cctx, char_u *name) in generate_funcref() argument
3103 ufunc_T *ufunc = find_func(name, FALSE, cctx); in generate_funcref()
3113 return generate_PUSHFUNC(cctx, ufunc->uf_name, ufunc->uf_func_type); in generate_funcref()
3126 cctx_T *cctx, in compile_load() argument
3153 if (generate_instr_type(cctx, isn_type, &t_dict_any) == NULL) in compile_load()
3168 case 'v': res = generate_LOADV(cctx, name, error); in compile_load()
3171 && find_func(name, FALSE, cctx) != NULL) in compile_load()
3172 res = generate_funcref(cctx, name); in compile_load()
3174 res = compile_load_scriptvar(cctx, name, in compile_load()
3180 && find_func(name, FALSE, cctx) != NULL) in compile_load()
3181 res = generate_funcref(cctx, name); in compile_load()
3206 res = generate_LOAD(cctx, isn_type, 0, name, &t_any); in compile_load()
3224 res = generate_LOAD(cctx, ISN_LOADAUTO, 0, name, &t_any); in compile_load()
3226 else if (arg_exists(*arg, len, &idx, &type, &gen_load_outer, cctx) in compile_load()
3236 if (lookup_local(*arg, len, &lvar, cctx) == OK) in compile_load()
3249 if (script_var_exists(*arg, len, cctx) == OK in compile_load()
3250 || find_imported(name, 0, cctx) != NULL) in compile_load()
3251 res = compile_load_scriptvar(cctx, name, *arg, &end, FALSE); in compile_load()
3257 res = generate_funcref(cctx, name); in compile_load()
3261 res = generate_LOAD(cctx, ISN_LOAD, idx, NULL, type); in compile_load()
3264 res = generate_LOADOUTER(cctx, idx, gen_load_outer, type); in compile_load()
3265 cctx->ctx_outer_used = TRUE; in compile_load()
3293 compile_string(isn_T *isn, cctx_T *cctx) in compile_string() argument
3296 garray_T save_ga = cctx->ctx_instr; in compile_string()
3303 --cctx->ctx_type_stack.ga_len; in compile_string()
3307 cctx->ctx_instr.ga_len = 0; in compile_string()
3308 cctx->ctx_instr.ga_maxlen = 0; in compile_string()
3309 cctx->ctx_instr.ga_data = NULL; in compile_string()
3310 expr_res = compile_expr0(&s, cctx); in compile_string()
3315 || GA_GROW_FAILS(&cctx->ctx_instr, 1)) in compile_string()
3319 clear_instr_ga(&cctx->ctx_instr); in compile_string()
3320 cctx->ctx_instr = save_ga; in compile_string()
3321 ++cctx->ctx_type_stack.ga_len; in compile_string()
3327 instr_count = cctx->ctx_instr.ga_len; in compile_string()
3328 instr = cctx->ctx_instr.ga_data; in compile_string()
3331 cctx->ctx_instr = save_ga; in compile_string()
3343 compile_arguments(char_u **arg, cctx_T *cctx, int *argcount, int is_searchpair) in compile_arguments() argument
3352 if (may_get_next_line(whitep, &p, cctx) == FAIL) in compile_arguments()
3365 instr_count = cctx->ctx_instr.ga_len; in compile_arguments()
3366 if (compile_expr0(&p, cctx) == FAIL) in compile_arguments()
3371 && cctx->ctx_instr.ga_len == instr_count + 1) in compile_arguments()
3373 isn_T *isn = ((isn_T *)cctx->ctx_instr.ga_data) + instr_count; in compile_arguments()
3377 compile_string(isn, cctx); in compile_arguments()
3414 cctx_T *cctx, in compile_call() argument
3471 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_call()
3490 if (compile_arguments(arg, cctx, &argcount, is_searchpair) == FAIL) in compile_call()
3510 garray_T *stack = &cctx->ctx_type_stack; in compile_call()
3518 res = generate_LISTAPPEND(cctx); in compile_call()
3524 res = generate_BLOBAPPEND(cctx); in compile_call()
3530 res = generate_BCALL(cctx, idx, argcount, argcount_init == 1); in compile_call()
3539 if (lookup_local(namebuf, varlen, NULL, cctx) == FAIL in compile_call()
3540 && arg_exists(namebuf, varlen, NULL, NULL, NULL, cctx) != OK) in compile_call()
3544 ufunc = find_func(name, FALSE, cctx); in compile_call()
3547 res = generate_CALL(cctx, ufunc, argcount); in compile_call()
3557 && compile_load(&p, namebuf + varlen, cctx, FALSE, FALSE) == OK) in compile_call()
3559 garray_T *stack = &cctx->ctx_type_stack; in compile_call()
3562 res = generate_PCALL(cctx, argcount, namebuf, type, FALSE); in compile_call()
3569 res = generate_CALL(cctx, ufunc, argcount); in compile_call()
3576 res = generate_UCALL(cctx, name, argcount); in compile_call()
3644 compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_list() argument
3654 if (may_get_next_line(whitep, &p, cctx) == FAIL) in compile_list()
3669 if (compile_expr0_ext(&p, cctx, &is_const) == FAIL) in compile_list()
3689 return generate_NEWLIST(cctx, count); in compile_list()
3698 compile_lambda(char_u **arg, cctx_T *cctx) in compile_lambda() argument
3707 evalarg.eval_cctx = cctx; in compile_lambda()
3727 compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx); in compile_lambda()
3732 if (cctx->ctx_compile_type == CT_PROFILE) in compile_lambda()
3733 compile_def_function(ufunc, FALSE, CT_NONE, cctx); in compile_lambda()
3744 *arg = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum] in compile_lambda()
3758 return generate_FUNCREF(cctx, ufunc); in compile_lambda()
3812 compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_dict() argument
3814 garray_T *instr = &cctx->ctx_instr; in compile_dict()
3825 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_dict()
3831 if (may_get_next_line(whitep, arg, cctx) == FAIL) in compile_dict()
3846 if (compile_expr0(arg, cctx) == FAIL) in compile_dict()
3860 else if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_dict()
3878 if (generate_PUSHS(cctx, &key) == FAIL) in compile_dict()
3916 if (may_get_next_line(whitep, arg, cctx) == FAIL) in compile_dict()
3922 if (compile_expr0_ext(arg, cctx, &is_const) == FAIL) in compile_dict()
3929 if (may_get_next_line(whitep, arg, cctx) == FAIL) in compile_dict()
3964 return generate_NEWDICT(cctx, count); in compile_dict()
3980 compile_get_option(char_u **arg, cctx_T *cctx) in compile_get_option() argument
3996 ret = generate_LOAD(cctx, ISN_LOADOPT, 0, name, type); in compile_get_option()
4008 compile_get_env(char_u **arg, cctx_T *cctx) in compile_get_env() argument
4025 ret = generate_LOAD(cctx, ISN_LOADENV, 0, name, &t_string); in compile_get_env()
4034 compile_get_register(char_u **arg, cctx_T *cctx) in compile_get_register() argument
4049 ret = generate_LOAD(cctx, ISN_LOADREG, **arg, NULL, &t_string); in compile_get_register()
4202 skip_expr_cctx(char_u **arg, cctx_T *cctx) in skip_expr_cctx() argument
4207 evalarg.eval_cctx = cctx; in skip_expr_cctx()
4217 compile_leader(cctx_T *cctx, int numeric_only, char_u *start, char_u **end) in compile_leader() argument
4231 garray_T *stack = &cctx->ctx_type_stack; in compile_leader()
4235 if (need_type(type, &t_number, -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_leader()
4247 isn = generate_instr(cctx, ISN_NEGATENR); in compile_leader()
4267 if (generate_2BOOL(cctx, invert, -1) == FAIL) in compile_leader()
4280 compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_parenthesis() argument
4285 if (may_get_next_line_error(p, arg, cctx) == FAIL) in compile_parenthesis()
4289 ret = compile_expr1(arg, cctx, ppconst); in compile_parenthesis()
4294 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_parenthesis()
4296 ret = compile_expr0(arg, cctx); in compile_parenthesis()
4298 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) in compile_parenthesis()
4317 cctx_T *cctx, in compile_subscript() argument
4331 char_u *next = peek_next_line_from_context(cctx); in compile_subscript()
4342 next = next_line_from_context(cctx, TRUE); in compile_subscript()
4354 garray_T *stack = &cctx->ctx_type_stack; in compile_subscript()
4358 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_subscript()
4366 if (compile_arguments(arg, cctx, &argcount, FALSE) == FAIL) in compile_subscript()
4368 if (generate_PCALL(cctx, argcount, name_start, type, TRUE) == FAIL) in compile_subscript()
4373 if (generate_instr(cctx, ISN_CLEARDICT) == NULL) in compile_subscript()
4381 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_subscript()
4388 if (compile_leader(cctx, TRUE, start_leader, end_leader) == FAIL) in compile_subscript()
4397 garray_T *stack = &cctx->ctx_type_stack; in compile_subscript()
4400 int expr_isn_start = cctx->ctx_instr.ga_len; in compile_subscript()
4408 if (compile_parenthesis(arg, cctx, ppconst) == FAIL) in compile_subscript()
4413 expr_isn_end = cctx->ctx_instr.ga_len; in compile_subscript()
4425 if (compile_arguments(arg, cctx, &argcount, FALSE) == FAIL) in compile_subscript()
4432 stack = &cctx->ctx_type_stack; in compile_subscript()
4433 arg_isn_count = cctx->ctx_instr.ga_len - expr_isn_end; in compile_subscript()
4441 mch_memmove(isn, ((isn_T *)cctx->ctx_instr.ga_data) in compile_subscript()
4444 mch_memmove(((isn_T *)cctx->ctx_instr.ga_data) in compile_subscript()
4446 ((isn_T *)cctx->ctx_instr.ga_data) + expr_isn_end, in compile_subscript()
4448 mch_memmove(((isn_T *)cctx->ctx_instr.ga_data) in compile_subscript()
4462 if (generate_PCALL(cctx, argcount, p - 2, type, FALSE) == FAIL) in compile_subscript()
4483 if (compile_call(arg, p - *arg, cctx, ppconst, 1) == FAIL) in compile_subscript()
4489 if (generate_instr(cctx, ISN_CLEARDICT) == NULL) in compile_subscript()
4501 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_subscript()
4506 if (may_get_next_line_error(p, arg, cctx) == FAIL) in compile_subscript()
4511 generate_PUSHNR(cctx, 0); in compile_subscript()
4515 if (compile_expr0(arg, cctx) == FAIL) in compile_subscript()
4523 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) in compile_subscript()
4537 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) in compile_subscript()
4541 generate_PUSHNR(cctx, -1); in compile_subscript()
4544 if (compile_expr0(arg, cctx) == FAIL) in compile_subscript()
4546 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) in compile_subscript()
4562 if (generate_instr(cctx, ISN_CLEARDICT) == NULL) in compile_subscript()
4565 if (compile_member(is_slice, &keeping_dict, cctx) == FAIL) in compile_subscript()
4571 if (generate_ppconst(cctx, ppconst) == FAIL) in compile_subscript()
4590 if (keeping_dict && generate_instr(cctx, ISN_CLEARDICT) == NULL) in compile_subscript()
4592 if (generate_STRINGMEMBER(cctx, *arg, p - *arg) == FAIL) in compile_subscript()
4603 if (keeping_dict && generate_instr(cctx, ISN_USEDICT) == NULL) in compile_subscript()
4645 cctx_T *cctx, in compile_expr7() argument
4758 case '[': if (generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4760 ret = compile_list(arg, cctx, ppconst); in compile_expr7()
4766 case '{': if (generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4768 ret = compile_dict(arg, cctx, ppconst); in compile_expr7()
4774 case '&': if (generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4776 ret = compile_get_option(arg, cctx); in compile_expr7()
4782 case '$': if (generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4784 ret = compile_get_env(arg, cctx); in compile_expr7()
4790 case '@': if (generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4792 ret = compile_get_register(arg, cctx); in compile_expr7()
4800 ret = compile_lambda(arg, cctx); in compile_expr7()
4802 ret = compile_parenthesis(arg, cctx, ppconst); in compile_expr7()
4813 if (cctx->ctx_skip == SKIP_YES) in compile_expr7()
4847 r = compile_call(arg, p - *arg, cctx, ppconst, 0); in compile_expr7()
4851 if (cctx->ctx_skip != SKIP_YES in compile_expr7()
4852 && generate_ppconst(cctx, ppconst) == FAIL) in compile_expr7()
4854 r = compile_load(arg, p, cctx, TRUE, TRUE); in compile_expr7()
4862 if (compile_subscript(arg, cctx, start_leader, &end_leader, in compile_expr7()
4873 if (compile_leader(cctx, FALSE, start_leader, &end_leader) == FAIL) in compile_expr7()
4894 compile_expr7t(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr7t() argument
4902 want_type = parse_type(arg, cctx->ctx_type_list, TRUE); in compile_expr7t()
4915 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) in compile_expr7t()
4919 if (compile_expr7(arg, cctx, ppconst) == FAIL) in compile_expr7t()
4924 garray_T *stack = &cctx->ctx_type_stack; in compile_expr7t()
4928 generate_ppconst(cctx, ppconst); in compile_expr7t()
4932 if (need_type(actual, want_type, -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_expr7t()
4946 compile_expr6(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr6() argument
4953 if (compile_expr7t(arg, cctx, ppconst) == FAIL) in compile_expr6()
4961 op = may_peek_next_line(cctx, *arg, &next); in compile_expr6()
4966 *arg = next_line_from_context(cctx, TRUE); in compile_expr6()
4975 if (may_get_next_line_error(op + 1, arg, cctx) == FAIL) in compile_expr6()
4979 if (compile_expr7t(arg, cctx, ppconst) == FAIL) in compile_expr6()
5010 generate_ppconst(cctx, ppconst); in compile_expr6()
5011 generate_two_op(cctx, op); in compile_expr6()
5024 compile_expr5(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr5() argument
5032 if (compile_expr6(arg, cctx, ppconst) == FAIL) in compile_expr5()
5040 op = may_peek_next_line(cctx, *arg, &next); in compile_expr5()
5050 *arg = next_line_from_context(cctx, TRUE); in compile_expr5()
5060 if (may_get_next_line_error(op + oplen, arg, cctx) == FAIL) in compile_expr5()
5064 if (compile_expr6(arg, cctx, ppconst) == FAIL) in compile_expr5()
5104 generate_ppconst(cctx, ppconst); in compile_expr5()
5108 if (may_generate_2STRING(-2, FALSE, cctx) == FAIL in compile_expr5()
5109 || may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_expr5()
5111 generate_instr_drop(cctx, ISN_CONCAT, 1); in compile_expr5()
5114 generate_two_op(cctx, op); in compile_expr5()
5139 compile_expr4(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr4() argument
5149 if (compile_expr5(arg, cctx, ppconst) == FAIL) in compile_expr4()
5152 p = may_peek_next_line(cctx, *arg, &next); in compile_expr4()
5164 *arg = next_line_from_context(cctx, TRUE); in compile_expr4()
5190 if (may_get_next_line_error(p + len, arg, cctx) == FAIL) in compile_expr4()
5193 if (compile_expr5(arg, cctx, ppconst) == FAIL) in compile_expr4()
5219 generate_ppconst(cctx, ppconst); in compile_expr4()
5220 return generate_COMPARE(cctx, type, ic); in compile_expr4()
5226 static int compile_expr3(char_u **arg, cctx_T *cctx, ppconst_T *ppconst);
5234 cctx_T *cctx, in compile_and_or() argument
5240 char_u *p = may_peek_next_line(cctx, *arg, &next); in compile_and_or()
5245 garray_T *instr = &cctx->ctx_instr; in compile_and_or()
5247 int save_skip = cctx->ctx_skip; in compile_and_or()
5257 int start_ctx_lnum = cctx->ctx_lnum; in compile_and_or()
5266 *arg = next_line_from_context(cctx, TRUE); in compile_and_or()
5280 save_lnum = cctx->ctx_lnum; in compile_and_or()
5281 cctx->ctx_lnum = start_ctx_lnum; in compile_and_or()
5297 cctx->ctx_skip = SKIP_YES; in compile_and_or()
5313 status = bool_on_stack(cctx); in compile_and_or()
5318 cctx->ctx_lnum = save_lnum; in compile_and_or()
5327 if (cctx->ctx_skip != SKIP_YES) in compile_and_or()
5332 generate_JUMP(cctx, jump_when, 0); in compile_and_or()
5337 if (may_get_next_line_error(p + 2, arg, cctx) == FAIL) in compile_and_or()
5344 if ((opchar == '|' ? compile_expr3(arg, cctx, ppconst) in compile_and_or()
5345 : compile_expr4(arg, cctx, ppconst)) == FAIL) in compile_and_or()
5365 p = may_peek_next_line(cctx, *arg, &next); in compile_and_or()
5374 if (cctx->ctx_skip != SKIP_YES && ppconst->pp_used == 0) in compile_and_or()
5376 if (bool_on_stack(cctx) == FAIL) in compile_and_or()
5385 generate_ppconst(cctx, ppconst); in compile_and_or()
5398 cctx->ctx_skip = save_skip; in compile_and_or()
5417 compile_expr3(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr3() argument
5422 if (compile_expr4(arg, cctx, ppconst) == FAIL) in compile_expr3()
5426 return compile_and_or(arg, cctx, "&&", ppconst, ppconst_used); in compile_expr3()
5442 compile_expr2(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr2() argument
5447 if (compile_expr3(arg, cctx, ppconst) == FAIL) in compile_expr2()
5451 return compile_and_or(arg, cctx, "||", ppconst, ppconst_used); in compile_expr2()
5472 compile_expr1(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) in compile_expr1() argument
5479 if (cctx->ctx_skip == SKIP_YES) in compile_expr1()
5481 skip_expr_cctx(arg, cctx); in compile_expr1()
5486 if (compile_expr2(arg, cctx, ppconst) == FAIL) in compile_expr1()
5489 p = may_peek_next_line(cctx, *arg, &next); in compile_expr1()
5493 garray_T *instr = &cctx->ctx_instr; in compile_expr1()
5494 garray_T *stack = &cctx->ctx_type_stack; in compile_expr1()
5501 int save_skip = cctx->ctx_skip; in compile_expr1()
5505 *arg = next_line_from_context(cctx, TRUE); in compile_expr1()
5532 cctx->ctx_skip = save_skip == SKIP_YES || in compile_expr1()
5535 if (op_falsy && cctx->ctx_skip == SKIP_YES) in compile_expr1()
5537 generate_ppconst(cctx, ppconst); in compile_expr1()
5546 generate_ppconst(cctx, ppconst); in compile_expr1()
5549 generate_JUMP(cctx, op_falsy in compile_expr1()
5556 if (may_get_next_line_error(p + 1 + op_falsy, arg, cctx) == FAIL) in compile_expr1()
5558 if (compile_expr1(arg, cctx, ppconst) == FAIL) in compile_expr1()
5563 generate_ppconst(cctx, ppconst); in compile_expr1()
5572 generate_JUMP(cctx, JUMP_ALWAYS, 0); in compile_expr1()
5583 p = may_peek_next_line(cctx, *arg, &next); in compile_expr1()
5591 *arg = next_line_from_context(cctx, TRUE); in compile_expr1()
5604 cctx->ctx_skip = save_skip == SKIP_YES || const_value in compile_expr1()
5606 if (may_get_next_line_error(p + 1, arg, cctx) == FAIL) in compile_expr1()
5608 if (compile_expr1(arg, cctx, ppconst) == FAIL) in compile_expr1()
5616 generate_ppconst(cctx, ppconst); in compile_expr1()
5620 common_type(type1, *typep, typep, cctx->ctx_type_list); in compile_expr1()
5627 cctx->ctx_skip = save_skip; in compile_expr1()
5638 compile_expr0_ext(char_u **arg, cctx_T *cctx, int *is_const) in compile_expr0_ext() argument
5643 if (compile_expr1(arg, cctx, &ppconst) == FAIL) in compile_expr0_ext()
5650 if (generate_ppconst(cctx, &ppconst) == FAIL) in compile_expr0_ext()
5659 compile_expr0(char_u **arg, cctx_T *cctx) in compile_expr0() argument
5661 return compile_expr0_ext(arg, cctx, NULL); in compile_expr0()
5669 compile_return(char_u *arg, int check_return_type, int legacy, cctx_T *cctx) in compile_return() argument
5672 garray_T *stack = &cctx->ctx_type_stack; in compile_return()
5681 generate_LEGACY_EVAL(cctx, p); in compile_return()
5682 if (need_type(&t_any, cctx->ctx_ufunc->uf_ret_type, -1, in compile_return()
5683 0, cctx, FALSE, FALSE) == FAIL) in compile_return()
5692 if (compile_expr0(&p, cctx) == FAIL) in compile_return()
5696 if (cctx->ctx_skip != SKIP_YES) in compile_return()
5702 if ((check_return_type && (cctx->ctx_ufunc->uf_ret_type == NULL in compile_return()
5703 || cctx->ctx_ufunc->uf_ret_type == &t_unknown in compile_return()
5704 || cctx->ctx_ufunc->uf_ret_type == &t_any)) in compile_return()
5706 && cctx->ctx_ufunc->uf_ret_type == &t_unknown)) in compile_return()
5708 cctx->ctx_ufunc->uf_ret_type = stack_type; in compile_return()
5712 if (cctx->ctx_ufunc->uf_ret_type->tt_type == VAR_VOID in compile_return()
5719 if (need_type(stack_type, cctx->ctx_ufunc->uf_ret_type, -1, in compile_return()
5720 0, cctx, FALSE, FALSE) == FAIL) in compile_return()
5729 if (cctx->ctx_ufunc->uf_ret_type->tt_type != VAR_VOID in compile_return()
5730 && cctx->ctx_ufunc->uf_ret_type->tt_type != VAR_UNKNOWN) in compile_return()
5737 generate_PUSHNR(cctx, 0); in compile_return()
5741 generate_undo_cmdmods(cctx); in compile_return()
5743 if (cctx->ctx_skip != SKIP_YES && generate_instr(cctx, ISN_RETURN) == NULL) in compile_return()
5762 cctx_T *cctx = (cctx_T *)cookie; in exarg_getline() local
5767 if (cctx->ctx_lnum >= cctx->ctx_ufunc->uf_lines.ga_len - 1) in exarg_getline()
5769 ++cctx->ctx_lnum; in exarg_getline()
5770 p = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum]; in exarg_getline()
5778 fill_exarg_from_cctx(exarg_T *eap, cctx_T *cctx) in fill_exarg_from_cctx() argument
5781 eap->cookie = cctx; in fill_exarg_from_cctx()
5788 compile_nested_function(exarg_T *eap, cctx_T *cctx) in compile_nested_function() argument
5820 if (generate_DEF(cctx, name_start, name_end - name_start) == FAIL) in compile_nested_function()
5831 if (check_defined(name_start, name_end - name_start, cctx, FALSE) == FAIL) in compile_nested_function()
5835 fill_exarg_from_cctx(eap, cctx); in compile_nested_function()
5850 if (!is_global && cctx->ctx_ufunc->uf_block_depth > 0) in compile_nested_function()
5852 int block_depth = cctx->ctx_ufunc->uf_block_depth; in compile_nested_function()
5857 mch_memmove(ufunc->uf_block_ids, cctx->ctx_ufunc->uf_block_ids, in compile_nested_function()
5867 if (cctx->ctx_compile_type == CT_PROFILE) in compile_nested_function()
5871 && compile_def_function(ufunc, TRUE, compile_type, cctx) == FAIL) in compile_nested_function()
5881 compile_def_function(ufunc, FALSE, CT_NONE, cctx); in compile_nested_function()
5893 r = generate_NEWFUNC(cctx, lambda_name, func_name); in compile_nested_function()
5900 lvar_T *lvar = reserve_local(cctx, name_start, name_end - name_start, in compile_nested_function()
5905 if (generate_FUNCREF(cctx, ufunc) == FAIL) in compile_nested_function()
5907 r = generate_STORE(cctx, ISN_STORE, lvar->lv_idx, NULL); in compile_nested_function()
5942 cctx_T *cctx, in generate_loadvar() argument
5951 generate_LOAD(cctx, ISN_LOADOPT, 0, name, type); in generate_loadvar()
5955 generate_LOAD(cctx, ISN_LOADG, 0, name + 2, type); in generate_loadvar()
5957 generate_LOAD(cctx, ISN_LOADAUTO, 0, name, type); in generate_loadvar()
5960 generate_LOAD(cctx, ISN_LOADB, 0, name + 2, type); in generate_loadvar()
5963 generate_LOAD(cctx, ISN_LOADW, 0, name + 2, type); in generate_loadvar()
5966 generate_LOAD(cctx, ISN_LOADT, 0, name + 2, type); in generate_loadvar()
5969 compile_load_scriptvar(cctx, in generate_loadvar()
5974 generate_LOAD(cctx, ISN_LOADENV, 0, name, type); in generate_loadvar()
5977 generate_LOAD(cctx, ISN_LOADREG, name[1], NULL, &t_string); in generate_loadvar()
5980 generate_LOADV(cctx, name + 2, TRUE); in generate_loadvar()
5984 generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer, in generate_loadvar()
5987 generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type); in generate_loadvar()
6056 cctx_T *cctx) in get_var_dest() argument
6152 *type = typval2type_vimvar(vtv, cctx->ctx_type_list); in get_var_dest()
6163 cctx_T *cctx, in generate_store_var() argument
6175 return generate_STOREOPT(cctx, skip_option_env_lead(name), in generate_store_var()
6179 return generate_STORE(cctx, vim_strchr(name, AUTOLOAD_CHAR) == NULL in generate_store_var()
6183 return generate_STORE(cctx, ISN_STOREB, 0, name); in generate_store_var()
6186 return generate_STORE(cctx, ISN_STOREW, 0, name); in generate_store_var()
6189 return generate_STORE(cctx, ISN_STORET, 0, name); in generate_store_var()
6191 return generate_STORE(cctx, ISN_STOREENV, 0, name + 1); in generate_store_var()
6193 return generate_STORE(cctx, ISN_STOREREG, in generate_store_var()
6196 return generate_STORE(cctx, ISN_STOREV, vimvaridx, NULL); in generate_store_var()
6200 return generate_OLDSCRIPT(cctx, ISN_STORES, name, in generate_store_var()
6202 return generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT, in generate_store_var()
6213 generate_store_lhs(cctx_T *cctx, lhs_T *lhs, int instr_count) in generate_store_lhs() argument
6216 return generate_store_var(cctx, lhs->lhs_dest, in generate_store_lhs()
6223 garray_T *instr = &cctx->ctx_instr; in generate_store_lhs()
6233 garray_T *stack = &cctx->ctx_type_stack; in generate_store_lhs()
6242 generate_STOREOUTER(cctx, lhs->lhs_lvar->lv_idx, in generate_store_lhs()
6245 generate_STORE(cctx, ISN_STORE, lhs->lhs_lvar->lv_idx, NULL); in generate_store_lhs()
6269 cctx_T *cctx) in compile_lhs() argument
6315 if (cctx->ctx_skip != SKIP_YES) in compile_lhs()
6321 &lhs->lhs_type, cctx) == FAIL) in compile_lhs()
6336 &lhs->lhs_local_lvar, cctx) == OK) in compile_lhs()
6343 &lhs->lhs_arg_lvar.lv_from_outer, cctx) == OK) in compile_lhs()
6367 cctx) in compile_lhs()
6369 cctx)) == OK; in compile_lhs()
6371 find_imported(var_start, lhs->lhs_varlen, cctx); in compile_lhs()
6388 else if (cctx->ctx_ufunc->uf_script_ctx_version in compile_lhs()
6409 cctx); in compile_lhs()
6421 else if (check_defined(var_start, lhs->lhs_varlen, cctx, FALSE) in compile_lhs()
6451 lhs->lhs_type = parse_type(&p, cctx->ctx_type_list, TRUE); in compile_lhs()
6471 && cctx->ctx_skip != SKIP_YES) in compile_lhs()
6492 lhs->lhs_lvar = reserve_local(cctx, var_start, lhs->lhs_varlen, in compile_lhs()
6563 cctx_T *cctx) in compile_assign_lhs() argument
6565 if (compile_lhs(var_start, lhs, cmdidx, heredoc, oplen, cctx) == FAIL) in compile_assign_lhs()
6586 has_list_index(char_u *idx_start, cctx_T *cctx) in has_list_index() argument
6598 save_skip = cctx->ctx_skip; in has_list_index()
6599 cctx->ctx_skip = SKIP_YES; in has_list_index()
6600 (void)compile_expr0(&p, cctx); in has_list_index()
6601 cctx->ctx_skip = save_skip; in has_list_index()
6614 cctx_T *cctx) in compile_assign_index() argument
6629 r = generate_PUSHNR(cctx, 0); in compile_assign_index()
6633 r = compile_expr0(&p, cctx); in compile_assign_index()
6652 r = generate_PUSHSPEC(cctx, VVAL_NONE); in compile_assign_index()
6654 r = compile_expr0(&p, cctx); in compile_assign_index()
6669 r = generate_PUSHS(cctx, &key); in compile_assign_index()
6682 cctx_T *cctx) in compile_load_lhs() argument
6688 int lines_len = cctx->ctx_ufunc->uf_lines.ga_len; in compile_load_lhs()
6690 garray_T *stack = &cctx->ctx_type_stack; in compile_load_lhs()
6696 cctx->ctx_ufunc->uf_lines.ga_len = cctx->ctx_lnum + 1; in compile_load_lhs()
6697 res = compile_expr0(&p, cctx); in compile_load_lhs()
6699 cctx->ctx_ufunc->uf_lines.ga_len = lines_len; in compile_load_lhs()
6713 && need_type(rhs_type, lhs->lhs_type->tt_member, -2, 0, cctx, in compile_load_lhs()
6718 generate_loadvar(cctx, lhs->lhs_dest, lhs->lhs_name, in compile_load_lhs()
6728 compile_load_lhs_with_index(lhs_T *lhs, char_u *var_start, cctx_T *cctx) in compile_load_lhs_with_index() argument
6730 compile_load_lhs(lhs, var_start, NULL, cctx); in compile_load_lhs_with_index()
6738 if (compile_assign_index(var_start, lhs, &range, cctx) == FAIL) in compile_load_lhs_with_index()
6748 if (compile_member(FALSE, NULL, cctx) == FAIL) in compile_load_lhs_with_index()
6765 cctx_T *cctx) in compile_assign_unlet() argument
6768 garray_T *stack = &cctx->ctx_type_stack; in compile_assign_unlet()
6771 if (compile_assign_index(var_start, lhs, &range, cctx) == FAIL) in compile_assign_unlet()
6796 && may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_assign_unlet()
6806 -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_assign_unlet()
6812 -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_assign_unlet()
6822 if (compile_load_lhs(lhs, var_start, rhs_type, cctx) == FAIL) in compile_assign_unlet()
6832 if (generate_instr_drop(cctx, ISN_STORERANGE, 4) == NULL) in compile_assign_unlet()
6837 isn_T *isn = generate_instr_drop(cctx, ISN_STOREINDEX, 3); in compile_assign_unlet()
6846 if (generate_instr_drop(cctx, ISN_UNLETRANGE, 3) == NULL) in compile_assign_unlet()
6851 if (generate_instr_drop(cctx, ISN_UNLETINDEX, 2) == NULL) in compile_assign_unlet()
6877 compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx) in compile_assignment() argument
6887 garray_T *instr = &cctx->ctx_instr; in compile_assignment()
6888 garray_T *stack = &cctx->ctx_type_stack; in compile_assignment()
6947 eap->cookie = cctx; in compile_assignment()
6952 if (cctx->ctx_skip != SKIP_YES) in compile_assignment()
6957 generate_PUSHS(cctx, &li->li_tv.vval.v_string); in compile_assignment()
6960 generate_NEWLIST(cctx, l->lv_len); in compile_assignment()
6975 if (may_get_next_line_error(wp, &p, cctx) == FAIL) in compile_assignment()
6977 if (compile_expr0(&p, cctx) == FAIL) in compile_assignment()
6981 if (cctx->ctx_skip != SKIP_YES) in compile_assignment()
6992 if (need_type(stacktype, &t_list_any, -1, 0, cctx, in compile_assignment()
6996 generate_CHECKLEN(cctx, semicolon ? var_count - 1 : var_count, in compile_assignment()
7033 is_decl, heredoc, oplen, cctx) == FAIL) in compile_assignment()
7040 -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_assignment()
7045 if (cctx->ctx_skip == SKIP_YES) in compile_assignment()
7051 (void)compile_expr0(&p, cctx); in compile_assignment()
7062 cctx) == FAIL) in compile_assignment()
7074 r = generate_PUSHNR(cctx, 1); in compile_assignment()
7081 --cctx->ctx_locals.ga_len; in compile_assignment()
7083 if (may_get_next_line_error(wp, &p, cctx) == FAIL) in compile_assignment()
7086 ++cctx->ctx_locals.ga_len; in compile_assignment()
7089 r = compile_expr0_ext(&p, cctx, &is_const); in compile_assignment()
7091 ++cctx->ctx_locals.ga_len; in compile_assignment()
7100 if (generate_SLICE(cctx, var_count - 1) == FAIL) in compile_assignment()
7107 if (generate_GETITEM(cctx, var_idx, *op != '=') == FAIL) in compile_assignment()
7156 cctx)) in compile_assignment()
7159 cctx, FALSE, is_const) == FAIL) in compile_assignment()
7175 -1, 0, cctx, FALSE, FALSE) == FAIL) in compile_assignment()
7202 generate_PUSHBOOL(cctx, VVAL_FALSE); in compile_assignment()
7206 generate_PUSHF(cctx, 0.0); in compile_assignment()
7210 generate_PUSHS(cctx, NULL); in compile_assignment()
7213 generate_PUSHBLOB(cctx, blob_alloc()); in compile_assignment()
7216 generate_PUSHFUNC(cctx, NULL, &t_func_void); in compile_assignment()
7219 generate_NEWLIST(cctx, 0); in compile_assignment()
7222 generate_NEWDICT(cctx, 0); in compile_assignment()
7225 generate_PUSHJOB(cctx, NULL); in compile_assignment()
7228 generate_PUSHCHANNEL(cctx, NULL); in compile_assignment()
7237 generate_PUSHNR(cctx, 0); in compile_assignment()
7246 if (cctx->ctx_skip == SKIP_YES) in compile_assignment()
7256 if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_assignment()
7269 need_type(stacktype, expected, -1, 0, cctx, in compile_assignment()
7276 if (generate_instr_drop(cctx, ISN_CONCAT, 1) == NULL) in compile_assignment()
7281 if (generate_add_instr(cctx, in compile_assignment()
7287 else if (generate_two_op(cctx, op) == FAIL) in compile_assignment()
7292 save_lnum = cctx->ctx_lnum; in compile_assignment()
7293 cctx->ctx_lnum = start_lnum - 1; in compile_assignment()
7299 if (compile_assign_unlet(var_start, &lhs, TRUE, rhs_type, cctx) in compile_assignment()
7302 cctx->ctx_lnum = save_lnum; in compile_assignment()
7312 generate_LOCKCONST(cctx); in compile_assignment()
7327 generate_SETTYPE(cctx, lhs.lhs_type); in compile_assignment()
7329 if (generate_store_lhs(cctx, &lhs, instr_count) == FAIL) in compile_assignment()
7331 cctx->ctx_lnum = save_lnum; in compile_assignment()
7335 cctx->ctx_lnum = save_lnum; in compile_assignment()
7345 if (generate_instr_drop(cctx, ISN_DROP, 1) == NULL) in compile_assignment()
7361 may_compile_assignment(exarg_T *eap, char_u **line, cctx_T *cctx) in may_compile_assignment() argument
7402 || variable_exists(eap->cmd, len, cctx)) in may_compile_assignment()
7404 *line = compile_assignment(eap->cmd, eap, CMD_SIZE, cctx); in may_compile_assignment()
7415 *line = compile_assignment(eap->cmd, eap, CMD_SIZE, cctx); in may_compile_assignment()
7452 cctx_T *cctx = coookie; in compile_unlet() local
7457 if (cctx->ctx_skip == SKIP_YES) in compile_unlet()
7464 ret = generate_UNLET(cctx, ISN_UNLETENV, p + 1, eap->forceit); in compile_unlet()
7477 ret = compile_lhs(p, &lhs, CMD_unlet, FALSE, 0, cctx); in compile_unlet()
7489 ret = compile_assign_unlet(p, &lhs, FALSE, &t_void, cctx); in compile_unlet()
7501 ret = generate_UNLET(cctx, ISN_UNLET, p, eap->forceit); in compile_unlet()
7519 cctx_T *cctx = coookie; in compile_lock_unlock() local
7527 if (cctx->ctx_skip == SKIP_YES) in compile_lock_unlock()
7535 if (lookup_local(p, end - p, NULL, cctx) == OK) in compile_lock_unlock()
7547 if (compile_load(&s, end, cctx, FALSE, FALSE) == FAIL) in compile_lock_unlock()
7564 ret = generate_EXEC(cctx, isn, buf); in compile_lock_unlock()
7577 compile_unletlock(char_u *arg, exarg_T *eap, cctx_T *cctx) in compile_unletlock() argument
7581 cctx); in compile_unletlock()
7589 compile_jump_to_end(endlabel_T **el, jumpwhen_T when, cctx_T *cctx) in compile_jump_to_end() argument
7591 garray_T *instr = &cctx->ctx_instr; in compile_jump_to_end()
7600 generate_JUMP(cctx, when, 0); in compile_jump_to_end()
7605 compile_fill_jump_to_end(endlabel_T **el, int jump_where, cctx_T *cctx) in compile_fill_jump_to_end() argument
7607 garray_T *instr = &cctx->ctx_instr; in compile_fill_jump_to_end()
7637 new_scope(cctx_T *cctx, scopetype_T type) in new_scope() argument
7643 scope->se_outer = cctx->ctx_scope; in new_scope()
7644 cctx->ctx_scope = scope; in new_scope()
7646 scope->se_local_count = cctx->ctx_locals.ga_len; in new_scope()
7654 drop_scope(cctx_T *cctx) in drop_scope() argument
7656 scope_T *scope = cctx->ctx_scope; in drop_scope()
7663 cctx->ctx_scope = scope->se_outer; in drop_scope()
7714 compile_if(char_u *arg, cctx_T *cctx) in compile_if() argument
7717 garray_T *instr = &cctx->ctx_instr; in compile_if()
7720 skip_T skip_save = cctx->ctx_skip; in compile_if()
7724 if (compile_expr1(&p, cctx, &ppconst) == FAIL) in compile_if()
7734 if (cctx->ctx_skip == SKIP_YES) in compile_if()
7746 cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES; in compile_if()
7751 cctx->ctx_skip = SKIP_UNKNOWN; in compile_if()
7752 if (generate_ppconst(cctx, &ppconst) == FAIL) in compile_if()
7754 if (bool_on_stack(cctx) == FAIL) in compile_if()
7759 generate_undo_cmdmods(cctx); in compile_if()
7761 scope = new_scope(cctx, IF_SCOPE); in compile_if()
7768 if (cctx->ctx_skip == SKIP_UNKNOWN) in compile_if()
7772 generate_JUMP(cctx, JUMP_IF_FALSE, 0); in compile_if()
7778 if (cctx->ctx_compile_type == CT_PROFILE && cctx->ctx_skip == SKIP_YES in compile_if()
7783 cctx->ctx_skip = SKIP_NOT; in compile_if()
7784 generate_instr(cctx, ISN_PROF_END); in compile_if()
7785 cctx->ctx_skip = SKIP_YES; in compile_if()
7793 compile_elseif(char_u *arg, cctx_T *cctx) in compile_elseif() argument
7796 garray_T *instr = &cctx->ctx_instr; in compile_elseif()
7799 scope_T *scope = cctx->ctx_scope; in compile_elseif()
7801 skip_T save_skip = cctx->ctx_skip; in compile_elseif()
7808 unwind_locals(cctx, scope->se_local_count); in compile_elseif()
7809 if (!cctx->ctx_had_return) in compile_elseif()
7812 if (cctx->ctx_skip == SKIP_NOT) in compile_elseif()
7815 cctx->ctx_skip = SKIP_YES; in compile_elseif()
7822 instr->ga_len = current_instr_idx(cctx); in compile_elseif()
7824 skip_expr_cctx(&p, cctx); in compile_elseif()
7828 if (cctx->ctx_skip == SKIP_UNKNOWN) in compile_elseif()
7847 if (cctx->ctx_compile_type == CT_DEBUG && instr->ga_len > 0 in compile_elseif()
7857 JUMP_ALWAYS, cctx) == FAIL) in compile_elseif()
7878 if (cctx->ctx_skip == SKIP_YES) in compile_elseif()
7880 cctx->ctx_skip = SKIP_UNKNOWN; in compile_elseif()
7882 if (cctx->ctx_compile_type == CT_PROFILE) in compile_elseif()
7885 generate_instr(cctx, ISN_PROF_START); in compile_elseif()
7889 if (cctx->ctx_compile_type == CT_DEBUG) in compile_elseif()
7892 generate_instr_debug(cctx); in compile_elseif()
7896 if (compile_expr1(&p, cctx, &ppconst) == FAIL) in compile_elseif()
7901 cctx->ctx_skip = save_skip; in compile_elseif()
7919 cctx->ctx_skip = v ? SKIP_NOT : SKIP_YES; in compile_elseif()
7926 cctx->ctx_skip = SKIP_UNKNOWN; in compile_elseif()
7927 if (generate_ppconst(cctx, &ppconst) == FAIL) in compile_elseif()
7929 if (bool_on_stack(cctx) == FAIL) in compile_elseif()
7933 generate_undo_cmdmods(cctx); in compile_elseif()
7937 generate_JUMP(cctx, JUMP_IF_FALSE, 0); in compile_elseif()
7944 compile_else(char_u *arg, cctx_T *cctx) in compile_else() argument
7947 garray_T *instr = &cctx->ctx_instr; in compile_else()
7949 scope_T *scope = cctx->ctx_scope; in compile_else()
7956 unwind_locals(cctx, scope->se_local_count); in compile_else()
7957 if (!cctx->ctx_had_return) in compile_else()
7962 if (cctx->ctx_compile_type == CT_PROFILE) in compile_else()
7964 if (cctx->ctx_skip == SKIP_NOT in compile_else()
7970 if (cctx->ctx_skip == SKIP_YES && !scope->se_u.se_if.is_seen_skip_not) in compile_else()
7974 cctx->ctx_skip = SKIP_NOT; in compile_else()
7975 generate_instr(cctx, ISN_PROF_END); in compile_else()
7976 generate_instr(cctx, ISN_PROF_START); in compile_else()
7977 cctx->ctx_skip = SKIP_YES; in compile_else()
7985 if (cctx->ctx_skip == SKIP_UNKNOWN) in compile_else()
7987 if (!cctx->ctx_had_return in compile_else()
7989 JUMP_ALWAYS, cctx) == FAIL) in compile_else()
7993 if (cctx->ctx_skip == SKIP_UNKNOWN) in compile_else()
8004 if (cctx->ctx_skip != SKIP_UNKNOWN) in compile_else()
8005 cctx->ctx_skip = cctx->ctx_skip == SKIP_YES ? SKIP_NOT : SKIP_YES; in compile_else()
8012 compile_endif(char_u *arg, cctx_T *cctx) in compile_endif() argument
8014 scope_T *scope = cctx->ctx_scope; in compile_endif()
8016 garray_T *instr = &cctx->ctx_instr; in compile_endif()
8019 if (misplaced_cmdmod(cctx)) in compile_endif()
8028 unwind_locals(cctx, scope->se_local_count); in compile_endif()
8029 if (!cctx->ctx_had_return) in compile_endif()
8039 compile_fill_jump_to_end(&ifscope->is_end_label, instr->ga_len, cctx); in compile_endif()
8044 if (cctx->ctx_compile_type == CT_PROFILE && cctx->ctx_skip == SKIP_YES in compile_endif()
8047 cctx->ctx_skip = SKIP_NOT; in compile_endif()
8048 generate_instr(cctx, ISN_PROF_START); in compile_endif()
8051 cctx->ctx_skip = scope->se_skip_save; in compile_endif()
8055 cctx->ctx_had_return = ifscope->is_had_return && ifscope->is_seen_else; in compile_endif()
8057 drop_scope(cctx); in compile_endif()
8082 compile_for(char_u *arg_start, cctx_T *cctx) in compile_for() argument
8093 garray_T *stack = &cctx->ctx_type_stack; in compile_for()
8094 garray_T *instr = &cctx->ctx_instr; in compile_for()
8101 int prev_lnum = cctx->ctx_prev_lnum; in compile_for()
8113 if (may_get_next_line_error(wp, &p, cctx) == FAIL) in compile_for()
8124 if (may_get_next_line_error(wp, &p, cctx) == FAIL) in compile_for()
8129 if (cctx->ctx_compile_type == CT_DEBUG && instr->ga_len > 0 in compile_for()
8138 scope = new_scope(cctx, FOR_SCOPE); in compile_for()
8144 loop_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number); in compile_for()
8148 drop_scope(cctx); in compile_for()
8151 generate_STORENR(cctx, loop_lvar->lv_idx, -1); in compile_for()
8155 if (compile_expr0(&arg, cctx) == FAIL) in compile_for()
8157 drop_scope(cctx); in compile_for()
8162 if (cctx->ctx_skip != SKIP_YES) in compile_for()
8172 drop_scope(cctx); in compile_for()
8192 generate_undo_cmdmods(cctx); in compile_for()
8195 scope->se_u.se_for.fs_top_label = current_instr_idx(cctx); in compile_for()
8197 generate_FOR(cctx, loop_lvar->lv_idx); in compile_for()
8202 generate_UNPACK(cctx, var_count, semicolon); in compile_for()
8208 drop_scope(cctx); in compile_for()
8237 lhs_type = parse_type(&p, cctx->ctx_type_list, TRUE); in compile_for()
8242 &vimvaridx, &type, cctx) == FAIL) in compile_for()
8246 if (generate_store_var(cctx, dest, opt_flags, vimvaridx, in compile_for()
8253 if (generate_instr_drop(cctx, ISN_DROP, 1) == NULL) in compile_for()
8258 if (lookup_local(arg, varlen, NULL, cctx) == OK) in compile_for()
8278 -1, 0, cctx, FALSE, FALSE) in compile_for()
8282 var_lvar = reserve_local(cctx, arg, varlen, TRUE, lhs_type); in compile_for()
8291 generate_STORE(cctx, ISN_STORE, var_lvar->lv_idx, NULL); in compile_for()
8300 if (cctx->ctx_compile_type == CT_DEBUG) in compile_for()
8302 int save_prev_lnum = cctx->ctx_prev_lnum; in compile_for()
8306 cctx->ctx_prev_lnum = prev_lnum; in compile_for()
8307 generate_instr_debug(cctx); in compile_for()
8308 cctx->ctx_prev_lnum = save_prev_lnum; in compile_for()
8316 drop_scope(cctx); in compile_for()
8324 compile_endfor(char_u *arg, cctx_T *cctx) in compile_endfor() argument
8326 garray_T *instr = &cctx->ctx_instr; in compile_endfor()
8327 scope_T *scope = cctx->ctx_scope; in compile_endfor()
8331 if (misplaced_cmdmod(cctx)) in compile_endfor()
8340 cctx->ctx_scope = scope->se_outer; in compile_endfor()
8341 if (cctx->ctx_skip != SKIP_YES) in compile_endfor()
8343 unwind_locals(cctx, scope->se_local_count); in compile_endfor()
8346 generate_JUMP(cctx, JUMP_ALWAYS, forscope->fs_top_label); in compile_endfor()
8353 compile_fill_jump_to_end(&forscope->fs_end_label, instr->ga_len, cctx); in compile_endfor()
8356 if (generate_instr_drop(cctx, ISN_DROP, 1) == NULL) in compile_endfor()
8377 compile_while(char_u *arg, cctx_T *cctx) in compile_while() argument
8382 scope = new_scope(cctx, WHILE_SCOPE); in compile_while()
8387 scope->se_u.se_while.ws_top_label = current_instr_idx(cctx); in compile_while()
8390 if (compile_expr0(&p, cctx) == FAIL) in compile_while()
8399 if (cctx->ctx_skip != SKIP_YES) in compile_while()
8401 if (bool_on_stack(cctx) == FAIL) in compile_while()
8405 generate_undo_cmdmods(cctx); in compile_while()
8409 JUMP_IF_FALSE, cctx) == FAIL) in compile_while()
8420 compile_endwhile(char_u *arg, cctx_T *cctx) in compile_endwhile() argument
8422 scope_T *scope = cctx->ctx_scope; in compile_endwhile()
8423 garray_T *instr = &cctx->ctx_instr; in compile_endwhile()
8425 if (misplaced_cmdmod(cctx)) in compile_endwhile()
8432 cctx->ctx_scope = scope->se_outer; in compile_endwhile()
8433 if (cctx->ctx_skip != SKIP_YES) in compile_endwhile()
8435 unwind_locals(cctx, scope->se_local_count); in compile_endwhile()
8439 may_generate_prof_end(cctx, cctx->ctx_lnum); in compile_endwhile()
8443 generate_JUMP(cctx, JUMP_ALWAYS, scope->se_u.se_while.ws_top_label); in compile_endwhile()
8448 instr->ga_len, cctx); in compile_endwhile()
8460 compile_continue(char_u *arg, cctx_T *cctx) in compile_continue() argument
8462 scope_T *scope = cctx->ctx_scope; in compile_continue()
8491 generate_TRYCONT(cctx, try_scopes, loop_label); in compile_continue()
8494 generate_JUMP(cctx, JUMP_ALWAYS, loop_label); in compile_continue()
8503 compile_break(char_u *arg, cctx_T *cctx) in compile_break() argument
8505 scope_T *scope = cctx->ctx_scope; in compile_break()
8525 if (compile_jump_to_end(el, JUMP_ALWAYS, cctx) == FAIL) in compile_break()
8535 compile_block(char_u *arg, cctx_T *cctx) in compile_block() argument
8537 if (new_scope(cctx, BLOCK_SCOPE) == NULL) in compile_block()
8546 compile_endblock(cctx_T *cctx) in compile_endblock() argument
8548 scope_T *scope = cctx->ctx_scope; in compile_endblock()
8550 cctx->ctx_scope = scope->se_outer; in compile_endblock()
8551 unwind_locals(cctx, scope->se_local_count); in compile_endblock()
8588 compile_try(char_u *arg, cctx_T *cctx) in compile_try() argument
8590 garray_T *instr = &cctx->ctx_instr; in compile_try()
8594 if (misplaced_cmdmod(cctx)) in compile_try()
8598 try_scope = new_scope(cctx, TRY_SCOPE); in compile_try()
8602 if (cctx->ctx_skip != SKIP_YES) in compile_try()
8611 if ((isn = generate_instr(cctx, ISN_TRY)) == NULL) in compile_try()
8619 scope = new_scope(cctx, BLOCK_SCOPE); in compile_try()
8630 compile_catch(char_u *arg, cctx_T *cctx UNUSED) in compile_catch()
8632 scope_T *scope = cctx->ctx_scope; in compile_catch()
8633 garray_T *instr = &cctx->ctx_instr; in compile_catch()
8637 if (misplaced_cmdmod(cctx)) in compile_catch()
8642 compile_endblock(cctx); in compile_catch()
8643 scope = cctx->ctx_scope; in compile_catch()
8658 if (cctx->ctx_skip != SKIP_YES) in compile_catch()
8662 if (cctx->ctx_compile_type == CT_PROFILE in compile_catch()
8670 JUMP_ALWAYS, cctx) == FAIL) in compile_catch()
8684 if (cctx->ctx_compile_type == CT_PROFILE) in compile_catch()
8687 generate_instr(cctx, ISN_PROF_END); in compile_catch()
8689 generate_instr(cctx, ISN_PROF_START); in compile_catch()
8692 if (cctx->ctx_compile_type == CT_DEBUG) in compile_catch()
8693 generate_instr_debug(cctx); in compile_catch()
8711 generate_instr_type(cctx, ISN_PUSHEXC, &t_string); in compile_catch()
8729 if (generate_PUSHS(cctx, &pat) == FAIL) in compile_catch()
8732 if (generate_COMPARE(cctx, EXPR_MATCH, FALSE) == FAIL) in compile_catch()
8736 if (generate_JUMP(cctx, JUMP_IF_FALSE, 0) == FAIL) in compile_catch()
8740 if (cctx->ctx_skip != SKIP_YES && generate_instr(cctx, ISN_CATCH) == NULL) in compile_catch()
8743 if (new_scope(cctx, BLOCK_SCOPE) == NULL) in compile_catch()
8749 compile_finally(char_u *arg, cctx_T *cctx) in compile_finally() argument
8751 scope_T *scope = cctx->ctx_scope; in compile_finally()
8752 garray_T *instr = &cctx->ctx_instr; in compile_finally()
8756 if (misplaced_cmdmod(cctx)) in compile_finally()
8761 compile_endblock(cctx); in compile_finally()
8762 scope = cctx->ctx_scope; in compile_finally()
8771 if (cctx->ctx_skip != SKIP_YES) in compile_finally()
8783 if (cctx->ctx_compile_type == CT_PROFILE in compile_finally()
8799 this_instr, cctx); in compile_finally()
8812 if (generate_instr(cctx, ISN_FINALLY) == NULL) in compile_finally()
8822 compile_endtry(char_u *arg, cctx_T *cctx) in compile_endtry() argument
8824 scope_T *scope = cctx->ctx_scope; in compile_endtry()
8825 garray_T *instr = &cctx->ctx_instr; in compile_endtry()
8828 if (misplaced_cmdmod(cctx)) in compile_endtry()
8833 compile_endblock(cctx); in compile_endtry()
8834 scope = cctx->ctx_scope; in compile_endtry()
8851 if (cctx->ctx_skip != SKIP_YES) in compile_endtry()
8861 if (cctx->ctx_compile_type == CT_PROFILE in compile_endtry()
8872 instr->ga_len, cctx); in compile_endtry()
8883 compile_endblock(cctx); in compile_endtry()
8885 if (cctx->ctx_skip != SKIP_YES) in compile_endtry()
8890 if (cctx->ctx_skip != SKIP_YES in compile_endtry()
8891 && generate_instr(cctx, ISN_ENDTRY) == NULL) in compile_endtry()
8894 if (cctx->ctx_compile_type == CT_PROFILE) in compile_endtry()
8895 generate_instr(cctx, ISN_PROF_START); in compile_endtry()
8905 compile_throw(char_u *arg, cctx_T *cctx UNUSED) in compile_throw()
8909 if (compile_expr0(&p, cctx) == FAIL) in compile_throw()
8911 if (cctx->ctx_skip == SKIP_YES) in compile_throw()
8913 if (may_generate_2STRING(-1, FALSE, cctx) == FAIL) in compile_throw()
8915 if (generate_instr_drop(cctx, ISN_THROW, 1) == NULL) in compile_throw()
8922 compile_eval(char_u *arg, cctx_T *cctx) in compile_eval() argument
8933 if (compile_expr0(&p, cctx) == FAIL) in compile_eval()
8943 generate_instr_drop(cctx, ISN_DROP, 1); in compile_eval()
8956 compile_mult_expr(char_u *arg, int cmdidx, cctx_T *cctx) in compile_mult_expr() argument
8962 int start_ctx_lnum = cctx->ctx_lnum; in compile_mult_expr()
8963 garray_T *stack = &cctx->ctx_type_stack; in compile_mult_expr()
8971 if (compile_expr0(&p, cctx) == FAIL) in compile_mult_expr()
8974 if (cctx->ctx_skip != SKIP_YES) in compile_mult_expr()
8992 long save_lnum = cctx->ctx_lnum; in compile_mult_expr()
8995 cctx->ctx_lnum = start_ctx_lnum; in compile_mult_expr()
8998 generate_ECHO(cctx, cmdidx == CMD_echo, count); in compile_mult_expr()
9000 generate_MULT_EXPR(cctx, ISN_EXECUTE, count); in compile_mult_expr()
9002 generate_MULT_EXPR(cctx, ISN_ECHOMSG, count); in compile_mult_expr()
9004 generate_MULT_EXPR(cctx, ISN_ECHOCONSOLE, count); in compile_mult_expr()
9006 generate_MULT_EXPR(cctx, ISN_ECHOERR, count); in compile_mult_expr()
9008 cctx->ctx_lnum = save_lnum; in compile_mult_expr()
9019 compile_variable_range(exarg_T *eap, cctx_T *cctx) in compile_variable_range() argument
9026 return generate_RANGE(cctx, vim_strnsave(eap->cmd, range_end - eap->cmd)); in compile_variable_range()
9034 compile_put(char_u *arg, exarg_T *eap, cctx_T *cctx) in compile_put() argument
9047 if (compile_expr0(&p, cctx) == FAIL) in compile_put()
9054 if (compile_variable_range(eap, cctx) == OK) in compile_put()
9073 generate_PUT(cctx, eap->regname, lnum); in compile_put()
9081 compile_exec(char_u *line_arg, exarg_T *eap, cctx_T *cctx) in compile_exec() argument
9089 if (cctx->ctx_skip == SKIP_YES) in compile_exec()
9094 if (cctx->ctx_has_cmdmod) in compile_exec()
9096 garray_T *instr = &cctx->ctx_instr; in compile_exec()
9105 cctx->ctx_has_cmdmod = FALSE; in compile_exec()
9158 fill_exarg_from_cctx(&ea, cctx); in compile_exec()
9221 generate_PUSHS(cctx, &val); in compile_exec()
9225 if (compile_expr0(&p, cctx) == FAIL) in compile_exec()
9227 may_generate_2STRING(-1, TRUE, cctx); in compile_exec()
9244 generate_PUSHS(cctx, &val); in compile_exec()
9250 generate_EXECCONCAT(cctx, count); in compile_exec()
9253 generate_EXEC(cctx, ISN_EXEC, line); in compile_exec()
9277 compile_script(char_u *line, cctx_T *cctx) in compile_script() argument
9279 if (cctx->ctx_skip != SKIP_YES) in compile_script()
9283 if ((isn = generate_instr(cctx, ISN_EXEC_SPLIT)) == NULL) in compile_script()
9295 compile_substitute(char_u *arg, exarg_T *eap, cctx_T *cctx) in compile_substitute() argument
9308 garray_T save_ga = cctx->ctx_instr; in compile_substitute()
9321 cctx->ctx_instr.ga_len = 0; in compile_substitute()
9322 cctx->ctx_instr.ga_maxlen = 0; in compile_substitute()
9323 cctx->ctx_instr.ga_data = NULL; in compile_substitute()
9324 expr_res = compile_expr0(&cmd, cctx); in compile_substitute()
9331 || GA_GROW_FAILS(&cctx->ctx_instr, 1)) in compile_substitute()
9335 clear_instr_ga(&cctx->ctx_instr); in compile_substitute()
9336 cctx->ctx_instr = save_ga; in compile_substitute()
9343 instr_count = cctx->ctx_instr.ga_len; in compile_substitute()
9344 instr = cctx->ctx_instr.ga_data; in compile_substitute()
9347 cctx->ctx_instr = save_ga; in compile_substitute()
9348 if ((isn = generate_instr(cctx, ISN_SUBSTITUTE)) == NULL) in compile_substitute()
9369 return compile_exec(arg, eap, cctx); in compile_substitute()
9373 compile_redir(char_u *line, exarg_T *eap, cctx_T *cctx) in compile_redir() argument
9376 lhs_T *lhs = &cctx->ctx_redir_lhs; in compile_redir()
9386 cctx) == FAIL) in compile_redir()
9392 generate_instr_type(cctx, ISN_REDIREND, &t_string); in compile_redir()
9395 generate_instr_drop(cctx, ISN_CONCAT, 1); in compile_redir()
9402 &t_string, cctx) == FAIL) in compile_redir()
9405 else if (generate_store_lhs(cctx, lhs, -1) == FAIL) in compile_redir()
9430 FALSE, FALSE, 1, cctx) == FAIL) in compile_redir()
9432 generate_instr(cctx, ISN_REDIRSTART); in compile_redir()
9445 return compile_exec(line, eap, cctx); in compile_redir()
9450 compile_cexpr(char_u *line, exarg_T *eap, cctx_T *cctx) in compile_cexpr() argument
9455 isn = generate_instr(cctx, ISN_CEXPR_AUCMD); in compile_cexpr()
9461 if (compile_expr0(&p, cctx) == FAIL) in compile_cexpr()
9464 isn = generate_instr(cctx, ISN_CEXPR_CORE); in compile_cexpr()
9555 cctx_T cctx; in compile_def_function() local
9601 CLEAR_FIELD(cctx); in compile_def_function()
9603 cctx.ctx_compile_type = compile_type; in compile_def_function()
9604 cctx.ctx_ufunc = ufunc; in compile_def_function()
9605 cctx.ctx_lnum = -1; in compile_def_function()
9606 cctx.ctx_outer = outer_cctx; in compile_def_function()
9607 ga_init2(&cctx.ctx_locals, sizeof(lvar_T), 10); in compile_def_function()
9608 ga_init2(&cctx.ctx_type_stack, sizeof(type_T *), 50); in compile_def_function()
9609 ga_init2(&cctx.ctx_imports, sizeof(imported_T), 10); in compile_def_function()
9610 cctx.ctx_type_list = &ufunc->uf_type_list; in compile_def_function()
9611 ga_init2(&cctx.ctx_instr, sizeof(isn_T), 50); in compile_def_function()
9612 instr = &cctx.ctx_instr; in compile_def_function()
9642 garray_T *stack = &cctx.ctx_type_stack; in compile_def_function()
9651 if (generate_JUMP_IF_ARG_SET(&cctx, i - count - off) == FAIL) in compile_def_function()
9658 r = compile_expr0(&arg, &cctx); in compile_def_function()
9677 if (generate_STORE(&cctx, ISN_STORE, i - count - off, NULL) == FAIL) in compile_def_function()
9709 && !(*line == '#' && (line == cctx.ctx_line_start in compile_def_function()
9719 line = next_line_from_context(&cctx, FALSE); in compile_def_function()
9720 if (cctx.ctx_lnum >= ufunc->uf_lines.ga_len) in compile_def_function()
9724 if (cctx.ctx_skip != SKIP_YES) in compile_def_function()
9725 may_generate_prof_end(&cctx, prof_lnum); in compile_def_function()
9751 if (cctx.ctx_compile_type == CT_PROFILE && cctx.ctx_lnum != prof_lnum in compile_def_function()
9752 && cctx.ctx_skip != SKIP_YES) in compile_def_function()
9754 may_generate_prof_end(&cctx, prof_lnum); in compile_def_function()
9756 prof_lnum = cctx.ctx_lnum; in compile_def_function()
9757 generate_instr(&cctx, ISN_PROF_START); in compile_def_function()
9760 if (cctx.ctx_compile_type == CT_DEBUG && cctx.ctx_lnum != debug_lnum in compile_def_function()
9761 && cctx.ctx_skip != SKIP_YES) in compile_def_function()
9763 debug_lnum = cctx.ctx_lnum; in compile_def_function()
9764 generate_instr_debug(&cctx); in compile_def_function()
9766 cctx.ctx_prev_lnum = cctx.ctx_lnum + 1; in compile_def_function()
9774 scopetype_T stype = cctx.ctx_scope == NULL in compile_def_function()
9775 ? NO_SCOPE : cctx.ctx_scope->se_type; in compile_def_function()
9779 compile_endblock(&cctx); in compile_def_function()
9797 line = compile_block(ea.cmd, &cctx); in compile_def_function()
9806 cctx.ctx_has_cmdmod = FALSE; in compile_def_function()
9816 generate_cmdmods(&cctx, &local_cmdmod); in compile_def_function()
9847 assign = may_compile_assignment(&ea, &line, &cctx); in compile_def_function()
9882 line = compile_exec(line, &ea, &cctx); in compile_def_function()
9889 ? NULL : item_exists, &cctx); in compile_def_function()
9893 if (cctx.ctx_skip != SKIP_YES) in compile_def_function()
9933 if (cctx.ctx_skip == SKIP_YES && ea.cmdidx != CMD_eval) in compile_def_function()
9947 if (cctx.ctx_had_return in compile_def_function()
9978 line = compile_nested_function(&ea, &cctx); in compile_def_function()
9989 local_cmdmod.cmod_flags & CMOD_LEGACY, &cctx); in compile_def_function()
9990 cctx.ctx_had_return = TRUE; in compile_def_function()
10001 line = compile_assignment(p, &ea, ea.cmdidx, &cctx); in compile_def_function()
10009 line = compile_unletlock(p, &ea, &cctx); in compile_def_function()
10018 line = compile_if(p, &cctx); in compile_def_function()
10021 line = compile_elseif(p, &cctx); in compile_def_function()
10022 cctx.ctx_had_return = FALSE; in compile_def_function()
10025 line = compile_else(p, &cctx); in compile_def_function()
10026 cctx.ctx_had_return = FALSE; in compile_def_function()
10029 line = compile_endif(p, &cctx); in compile_def_function()
10033 line = compile_while(p, &cctx); in compile_def_function()
10036 line = compile_endwhile(p, &cctx); in compile_def_function()
10037 cctx.ctx_had_return = FALSE; in compile_def_function()
10041 line = compile_for(p, &cctx); in compile_def_function()
10044 line = compile_endfor(p, &cctx); in compile_def_function()
10045 cctx.ctx_had_return = FALSE; in compile_def_function()
10048 line = compile_continue(p, &cctx); in compile_def_function()
10051 line = compile_break(p, &cctx); in compile_def_function()
10055 line = compile_try(p, &cctx); in compile_def_function()
10058 line = compile_catch(p, &cctx); in compile_def_function()
10059 cctx.ctx_had_return = FALSE; in compile_def_function()
10062 line = compile_finally(p, &cctx); in compile_def_function()
10063 cctx.ctx_had_return = FALSE; in compile_def_function()
10066 line = compile_endtry(p, &cctx); in compile_def_function()
10067 cctx.ctx_had_return = FALSE; in compile_def_function()
10070 line = compile_throw(p, &cctx); in compile_def_function()
10074 line = compile_eval(p, &cctx); in compile_def_function()
10083 line = compile_mult_expr(p, ea.cmdidx, &cctx); in compile_def_function()
10088 line = compile_put(p, &ea, &cctx); in compile_def_function()
10094 if (cctx.ctx_skip == SKIP_YES) in compile_def_function()
10099 line = compile_substitute(line, &ea, &cctx); in compile_def_function()
10105 line = compile_redir(line, &ea, &cctx); in compile_def_function()
10116 line = compile_cexpr(line, &ea, &cctx); in compile_def_function()
10133 if (cctx.ctx_skip != SKIP_YES) in compile_def_function()
10153 line = compile_exec(line, &ea, &cctx); in compile_def_function()
10157 line = compile_script(line, &cctx); in compile_def_function()
10167 line = compile_exec(line, &ea, &cctx); in compile_def_function()
10176 generate_undo_cmdmods(&cctx); in compile_def_function()
10178 if (cctx.ctx_type_stack.ga_len < 0) in compile_def_function()
10185 if (cctx.ctx_scope != NULL) in compile_def_function()
10187 if (cctx.ctx_scope->se_type == IF_SCOPE) in compile_def_function()
10189 else if (cctx.ctx_scope->se_type == WHILE_SCOPE) in compile_def_function()
10191 else if (cctx.ctx_scope->se_type == FOR_SCOPE) in compile_def_function()
10198 if (!cctx.ctx_had_return) in compile_def_function()
10209 generate_instr(&cctx, ISN_RETURN_VOID); in compile_def_function()
10221 if (cctx.ctx_compile_type == CT_PROFILE) in compile_def_function()
10228 if (cctx.ctx_compile_type == CT_DEBUG) in compile_def_function()
10239 dfunc->df_has_closure = cctx.ctx_has_closure; in compile_def_function()
10240 if (cctx.ctx_outer_used) in compile_def_function()
10268 while (cctx.ctx_scope != NULL) in compile_def_function()
10269 drop_scope(&cctx); in compile_def_function()
10277 if (cctx.ctx_redir_lhs.lhs_name != NULL) in compile_def_function()
10284 vim_free(cctx.ctx_redir_lhs.lhs_name); in compile_def_function()
10285 vim_free(cctx.ctx_redir_lhs.lhs_whole); in compile_def_function()
10295 free_imported(&cctx); in compile_def_function()
10296 free_locals(&cctx); in compile_def_function()
10297 ga_clear(&cctx.ctx_type_stack); in compile_def_function()