Patch 8.2.1064
Problem: Vim9: no line break allowed before comperators.
Solution: Check for comperator after line break.
Files: src/eval.c, src/testdir/test_vim9_expr.vim
*** ../vim-8.2.1063/src/eval.c 2020-06-26 21:38:48.139342910 +0200
--- src/eval.c 2020-06-26 21:54:18.728931481 +0200
***************
*** 2191,2196 ****
--- 2191,2197 ----
{
typval_T var2;
char_u *p;
+ int getnext;
int i;
exptype_T type = EXPR_UNKNOWN;
int len = 2;
***************
*** 2202,2208 ****
if (eval5(arg, rettv, evalarg) == FAIL)
return FAIL;
! p = *arg;
switch (p[0])
{
case '=': if (p[1] == '=')
--- 2203,2209 ----
if (eval5(arg, rettv, evalarg) == FAIL)
return FAIL;
! p = eval_next_non_blank(*arg, evalarg, &getnext);
switch (p[0])
{
case '=': if (p[1] == '=')
***************
*** 2247,2252 ****
--- 2248,2256 ----
*/
if (type != EXPR_UNKNOWN)
{
+ if (getnext)
+ *arg = eval_next_line(evalarg);
+
// extra question mark appended: ignore case
if (p[len] == '?')
{
*** ../vim-8.2.1063/src/testdir/test_vim9_expr.vim 2020-06-26
21:38:48.139342910 +0200
--- src/testdir/test_vim9_expr.vim 2020-06-26 21:59:11.212146541 +0200
***************
*** 529,534 ****
--- 529,571 ----
let x = 1
enddef
+ def Test_expr4_vimscript()
+ " only checks line continuation
+ let lines =<< trim END
+ vim9script
+ let var = 0
+ < 1
+ assert_equal(1, var)
+ END
+ CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ let var = 123
+ != 123
+ assert_equal(0, var)
+ END
+ CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ let list = [1, 2, 3]
+ let var = list
+ is list
+ assert_equal(1, var)
+ END
+ CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ let myblob = 0z1234
+ let var = myblob
+ isnot 0z11
+ assert_equal(1, var)
+ END
+ CheckScriptSuccess(lines)
+ enddef
+
func Test_expr4_fails()
let msg = "white space required before and after '>'"
call CheckDefFailure(["let x = 1>2"], msg)
*** ../vim-8.2.1063/src/version.c 2020-06-26 21:38:48.139342910 +0200
--- src/version.c 2020-06-26 22:00:12.667980966 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1064,
/**/
--
Lawmakers made it obligatory for everybody to take at least one bath
each week -- on Saturday night.
[real standing law in Vermont, United States of America]
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202006262001.05QK19j32578616%40masaka.moolenaar.net.