To: vim_dev@googlegroups.com Subject: Patch 8.2.2444 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2444 Problem: Vim9: compile error with combination of operator and list. Solution: Generate constants before parsing a list or dict. (closes #7757) Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.2443/src/vim9compile.c 2021-01-25 21:01:45.077861178 +0100 --- src/vim9compile.c 2021-01-31 21:44:00.265636107 +0100 *************** *** 4121,4133 **** /* * List: [expr, expr] */ ! case '[': ret = compile_list(arg, cctx, ppconst); break; /* * Dictionary: {'key': val, 'key': val} */ ! case '{': ret = compile_dict(arg, cctx, ppconst); break; /* --- 4121,4137 ---- /* * List: [expr, expr] */ ! case '[': if (generate_ppconst(cctx, ppconst) == FAIL) ! return FAIL; ! ret = compile_list(arg, cctx, ppconst); break; /* * Dictionary: {'key': val, 'key': val} */ ! case '{': if (generate_ppconst(cctx, ppconst) == FAIL) ! return FAIL; ! ret = compile_dict(arg, cctx, ppconst); break; /* *** ../vim-8.2.2443/src/testdir/test_vim9_expr.vim 2021-01-20 21:23:10.709286927 +0100 --- src/testdir/test_vim9_expr.vim 2021-01-31 21:46:46.748985214 +0100 *************** *** 1083,1088 **** --- 1083,1091 ---- assert_equal('a0.123', 'a' .. 0.123) endif + assert_equal(3, 1 + [2, 3, 4][0]) + assert_equal(5, 2 + {key: 3}['key']) + set digraph assert_equal('val: true', 'val: ' .. &digraph) set nodigraph *** ../vim-8.2.2443/src/version.c 2021-01-31 20:48:55.162175817 +0100 --- src/version.c 2021-01-31 21:45:13.313349054 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2444, /**/ -- FIRST HEAD: Oh! quick! get the sword out I want to cut his head off. THIRD HEAD: Oh, cut your own head off. SECOND HEAD: Yes - do us all a favour. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///