File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,12 @@ def Test_assign_index()
466466 d3.one.two.three = 123
467467 assert_equal ({one: {two: {three: 123 }}}, d3)
468468
469+ # should not read the next line when generating " a.b"
470+ var a = {}
471+ a .b = {}
472+ a .b .c = {}
473+ - >copy ()
474+
469475 lines = << trim END
470476 var d3: dict <dict<number> >
471477 d3.one = {}
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3266 ,
758760/**/
759761 3265 ,
760762/**/
Original file line number Diff line number Diff line change @@ -6536,19 +6536,25 @@ compile_load_lhs(
65366536 {
65376537 size_t varlen = lhs -> lhs_varlen ;
65386538 int c = var_start [varlen ];
6539+ int lines_len = cctx -> ctx_ufunc -> uf_lines .ga_len ;
65396540 char_u * p = var_start ;
65406541 garray_T * stack = & cctx -> ctx_type_stack ;
6542+ int res ;
65416543
6542- // Evaluate "ll[expr]" of "ll[expr][idx]"
6544+ // Evaluate "ll[expr]" of "ll[expr][idx]". End the line with a NUL and
6545+ // limit the lines array length to avoid skipping to a following line.
65436546 var_start [varlen ] = NUL ;
6544- if (compile_expr0 (& p , cctx ) == OK && p != var_start + varlen )
6547+ cctx -> ctx_ufunc -> uf_lines .ga_len = cctx -> ctx_lnum + 1 ;
6548+ res = compile_expr0 (& p , cctx );
6549+ var_start [varlen ] = c ;
6550+ cctx -> ctx_ufunc -> uf_lines .ga_len = lines_len ;
6551+ if (res == FAIL || p != var_start + varlen )
65456552 {
65466553 // this should not happen
6547- emsg ( _ ( e_missbrac ));
6548- var_start [ varlen ] = c ;
6554+ if ( res != FAIL )
6555+ emsg ( _ ( e_missbrac )) ;
65496556 return FAIL ;
65506557 }
6551- var_start [varlen ] = c ;
65526558
65536559 lhs -> lhs_type = stack -> ga_len == 0 ? & t_void
65546560 : ((type_T * * )stack -> ga_data )[stack -> ga_len - 1 ];
You can’t perform that action at this time.
0 commit comments