comparison src/vim9compile.c @ 19862:846fbbacce3a v8.2.0487

patch 8.2.0487: Vim9: compiling not sufficiently tested Commit: https://github.com/vim/vim/commit/bd5da371aafe5a2207065643502f4d1ff6b286c7 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 31 23:13:10 2020 +0200 patch 8.2.0487: Vim9: compiling not sufficiently tested Problem: Vim9: compiling not sufficiently tested. Solution: Add more tests. Fix bug with PCALL.
author Bram Moolenaar <Bram@vim.org>
date Tue, 31 Mar 2020 23:15:04 +0200
parents 37c4779ca8f5
children 8288884fdfe1
comparison
equal deleted inserted replaced
19861:e517915a786d 19862:846fbbacce3a
1193 1193
1194 stack->ga_len -= argcount; // drop the arguments 1194 stack->ga_len -= argcount; // drop the arguments
1195 1195
1196 // drop the funcref/partial, get back the return value 1196 // drop the funcref/partial, get back the return value
1197 ((type_T **)stack->ga_data)[stack->ga_len - 1] = &t_any; 1197 ((type_T **)stack->ga_data)[stack->ga_len - 1] = &t_any;
1198
1199 // If partial is above the arguments it must be cleared and replaced with
1200 // the return value.
1201 if (at_top && generate_instr(cctx, ISN_PCALL_END) == NULL)
1202 return FAIL;
1198 1203
1199 return OK; 1204 return OK;
1200 } 1205 }
1201 1206
1202 /* 1207 /*
5198 // find what follows. Also "&opt = val", "$ENV = val" and "@r = 5203 // find what follows. Also "&opt = val", "$ENV = val" and "@r =
5199 // val". 5204 // val".
5200 p = (*ea.cmd == '&' || *ea.cmd == '$' || *ea.cmd == '@') 5205 p = (*ea.cmd == '&' || *ea.cmd == '$' || *ea.cmd == '@')
5201 ? ea.cmd + 1 : ea.cmd; 5206 ? ea.cmd + 1 : ea.cmd;
5202 p = to_name_end(p, TRUE); 5207 p = to_name_end(p, TRUE);
5203 if ((p > ea.cmd && *p != NUL) || *p == '(') 5208 if (p > ea.cmd && *p != NUL)
5204 { 5209 {
5205 int oplen; 5210 int oplen;
5206 int heredoc; 5211 int heredoc;
5207 5212
5208 oplen = assignment_len(skipwhite(p), &heredoc); 5213 oplen = assignment_len(skipwhite(p), &heredoc);
5536 case ISN_NEWLIST: 5541 case ISN_NEWLIST:
5537 case ISN_OPNR: 5542 case ISN_OPNR:
5538 case ISN_OPFLOAT: 5543 case ISN_OPFLOAT:
5539 case ISN_OPANY: 5544 case ISN_OPANY:
5540 case ISN_PCALL: 5545 case ISN_PCALL:
5546 case ISN_PCALL_END:
5541 case ISN_PUSHF: 5547 case ISN_PUSHF:
5542 case ISN_PUSHNR: 5548 case ISN_PUSHNR:
5543 case ISN_PUSHBOOL: 5549 case ISN_PUSHBOOL:
5544 case ISN_PUSHSPEC: 5550 case ISN_PUSHSPEC:
5545 case ISN_RETURN: 5551 case ISN_RETURN: