0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3716: Vim9: range without a command is not compiled

Problem:    Vim9: range without a command is not compiled.
Solution:   Add the ISN_EXECRANGE byte code.
This commit is contained in:
Bram Moolenaar
2021-12-01 15:22:56 +00:00
parent f0e496a85a
commit e4eed8c6db
7 changed files with 136 additions and 45 deletions

View File

@@ -1774,6 +1774,28 @@ exec_instructions(ectx_T *ectx)
}
break;
// execute Ex command line that is only a range
case ISN_EXECRANGE:
{
exarg_T ea;
char *error = NULL;
CLEAR_FIELD(ea);
ea.cmdidx = CMD_SIZE;
ea.addr_type = ADDR_LINES;
ea.cmd = iptr->isn_arg.string;
parse_cmd_address(&ea, &error, FALSE);
if (error == NULL)
error = ex_range_without_command(&ea);
if (error != NULL)
{
SOURCING_LNUM = iptr->isn_lnum;
emsg(error);
goto on_error;
}
}
break;
// Evaluate an expression with legacy syntax, push it onto the
// stack.
case ISN_LEGACY_EVAL:
@@ -5068,6 +5090,9 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
case ISN_EXEC_SPLIT:
smsg("%s%4d EXEC_SPLIT %s", pfx, current, iptr->isn_arg.string);
break;
case ISN_EXECRANGE:
smsg("%s%4d EXECRANGE %s", pfx, current, iptr->isn_arg.string);
break;
case ISN_LEGACY_EVAL:
smsg("%s%4d EVAL legacy %s", pfx, current,
iptr->isn_arg.string);