0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1463: Vim9: list slice not supported yet

Problem:    Vim9: list slice not supported yet.
Solution:   Add support for list slicing.
This commit is contained in:
Bram Moolenaar
2020-08-15 22:14:53 +02:00
parent 11107bab7e
commit ed5918771f
9 changed files with 175 additions and 57 deletions

View File

@@ -3171,13 +3171,16 @@ compile_subscript(
{
if (is_slice)
{
emsg("Sorry, list slice not implemented yet");
return FAIL;
if (generate_instr_drop(cctx, ISN_LISTSLICE, 2) == FAIL)
return FAIL;
}
else
{
if ((*typep)->tt_type == VAR_LIST)
*typep = (*typep)->tt_member;
if (generate_instr_drop(cctx, ISN_LISTINDEX, 1) == FAIL)
return FAIL;
}
if ((*typep)->tt_type == VAR_LIST)
*typep = (*typep)->tt_member;
if (generate_instr_drop(cctx, ISN_LISTINDEX, 1) == FAIL)
return FAIL;
}
else
{
@@ -7095,6 +7098,7 @@ delete_instr(isn_T *isn)
case ISN_EXECUTE:
case ISN_FOR:
case ISN_LISTINDEX:
case ISN_LISTSLICE:
case ISN_STRINDEX:
case ISN_STRSLICE:
case ISN_GETITEM: