forked from aniani/vim
patch 8.2.2444: Vim9: compile error with combination of operator and list
Problem: Vim9: compile error with combination of operator and list. Solution: Generate constants before parsing a list or dict. (closes #7757)
This commit is contained in:
@@ -1083,6 +1083,9 @@ def Test_expr5()
|
|||||||
assert_equal('a0.123', 'a' .. 0.123)
|
assert_equal('a0.123', 'a' .. 0.123)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
assert_equal(3, 1 + [2, 3, 4][0])
|
||||||
|
assert_equal(5, 2 + {key: 3}['key'])
|
||||||
|
|
||||||
set digraph
|
set digraph
|
||||||
assert_equal('val: true', 'val: ' .. &digraph)
|
assert_equal('val: true', 'val: ' .. &digraph)
|
||||||
set nodigraph
|
set nodigraph
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2444,
|
||||||
/**/
|
/**/
|
||||||
2443,
|
2443,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -4121,13 +4121,17 @@ compile_expr7(
|
|||||||
/*
|
/*
|
||||||
* List: [expr, expr]
|
* List: [expr, expr]
|
||||||
*/
|
*/
|
||||||
case '[': ret = compile_list(arg, cctx, ppconst);
|
case '[': if (generate_ppconst(cctx, ppconst) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
ret = compile_list(arg, cctx, ppconst);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dictionary: {'key': val, 'key': val}
|
* Dictionary: {'key': val, 'key': val}
|
||||||
*/
|
*/
|
||||||
case '{': ret = compile_dict(arg, cctx, ppconst);
|
case '{': if (generate_ppconst(cctx, ppconst) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
ret = compile_dict(arg, cctx, ppconst);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user