To: vim_dev@googlegroups.com Subject: Patch 8.2.2013 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2013 Problem: Vim9: not skipping white space after unary minus. Solution: Skip whitespace. (closes #7324) Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.2012/src/vim9compile.c 2020-11-18 16:34:59.266884583 +0100 --- src/vim9compile.c 2020-11-18 17:37:41.642151289 +0100 *************** *** 3362,3367 **** --- 3362,3369 ---- while (p > start) { --p; + while (VIM_ISWHITE(*p)) + --p; if (*p == '-' || *p == '+') { int negate = *p == '-'; *** ../vim-8.2.2012/src/testdir/test_vim9_expr.vim 2020-11-18 17:17:11.961928659 +0100 --- src/testdir/test_vim9_expr.vim 2020-11-18 17:32:40.363107607 +0100 *************** *** 2300,2311 **** CheckScriptSuccess(lines) enddef ! def Test_expr7_negate() assert_equal(-99, -99) assert_equal(99, --99) var nr = 88 assert_equal(-88, -nr) ! assert_equal(88, --nr) enddef def Echo(arg: any): string --- 2300,2328 ---- CheckScriptSuccess(lines) enddef ! def Test_expr7_negate_add() assert_equal(-99, -99) + assert_equal(-99, - 99) assert_equal(99, --99) + assert_equal(99, -- 99) + assert_equal(99, - - 99) + assert_equal(99, +99) + assert_equal(-99, -+99) + assert_equal(-99, -+ 99) + assert_equal(-99, - +99) + assert_equal(-99, - + 99) + assert_equal(-99, +-99) + assert_equal(-99, + -99) + assert_equal(-99, + - 99) + var nr = 88 assert_equal(-88, -nr) ! assert_equal(-88, - nr) ! assert_equal(-88, - +nr) ! assert_equal(88, -- nr) ! assert_equal(88, + nr) ! assert_equal(88, --+ nr) ! assert_equal(88, - - nr) enddef def Echo(arg: any): string *** ../vim-8.2.2012/src/version.c 2020-11-18 17:17:11.965928644 +0100 --- src/version.c 2020-11-18 17:34:07.946831307 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2013, /**/ -- A cow comes flying over the battlements, lowing aggressively. The cow lands on GALAHAD'S PAGE, squashing him completely. "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 ///