To: vim_dev@googlegroups.com Subject: Patch 8.2.1283 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1283 Problem: Vim9: error for misplaced -> lacks argument. Solution: Use the pointer before it was advanced. Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.1282/src/vim9compile.c 2020-07-23 18:26:25.259695152 +0200 --- src/vim9compile.c 2020-07-23 19:05:07.471305789 +0200 *************** *** 3761,3766 **** --- 3761,3768 ---- } else if (*p == '-' && p[1] == '>') { + char_u *pstart = p; + if (generate_ppconst(cctx, ppconst) == FAIL) return FAIL; *************** *** 3786,3792 **** p = *arg; if (!eval_isnamec1(*p)) { ! semsg(_(e_trailing_arg), p); return FAIL; } if (ASCII_ISALPHA(*p) && p[1] == ':') --- 3788,3794 ---- p = *arg; if (!eval_isnamec1(*p)) { ! semsg(_(e_trailing_arg), pstart); return FAIL; } if (ASCII_ISALPHA(*p) && p[1] == ':') *** ../vim-8.2.1282/src/testdir/test_vim9_expr.vim 2020-07-23 15:37:59.331156413 +0200 --- src/testdir/test_vim9_expr.vim 2020-07-23 19:04:39.039457101 +0200 *************** *** 1532,1538 **** call CheckDefFailure(["let x = ''", "let y = x.memb"], 'E715:') ! call CheckDefFailure(["'yes'->", "Echo()"], 'E488:') call CheckDefExecFailure(["[1, 2->len()"], 'E697:') call CheckDefExecFailure(["#{a: 1->len()"], 'E488:') --- 1532,1538 ---- call CheckDefFailure(["let x = ''", "let y = x.memb"], 'E715:') ! call CheckDefFailure(["'yes'->", "Echo()"], 'E488: Trailing characters: ->') call CheckDefExecFailure(["[1, 2->len()"], 'E697:') call CheckDefExecFailure(["#{a: 1->len()"], 'E488:') *** ../vim-8.2.1282/src/version.c 2020-07-23 18:26:25.259695152 +0200 --- src/version.c 2020-07-23 19:03:51.203711700 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1283, /**/ -- Proof techniques #2: Proof by Oddity. SAMPLE: To prove that horses have an infinite number of legs. (1) Horses have an even number of legs. (2) They have two legs in back and fore legs in front. (3) This makes a total of six legs, which certainly is an odd number of legs for a horse. (4) But the only number that is both odd and even is infinity. (5) Therefore, horses must have an infinite number of legs. /// 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 ///