Patch 8.2.1429

4 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 12, 2020, 11:36:42 AM8/12/20
to vim...@googlegroups.com

Patch 8.2.1429
Problem: Vim9: no error for missing white after : in dict.
Solution: Check for white space. (closes #6671) Also check that there is no
white before the :.
Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim,
src/testdir/test_vim9_func.vim


*** ../vim-8.2.1428/src/vim9compile.c 2020-08-12 15:48:51.658129308 +0200
--- src/vim9compile.c 2020-08-12 17:32:22.668181763 +0200
***************
*** 2593,2606 ****
}
}

- *arg = skipwhite(*arg);
if (**arg != ':')
{
! semsg(_(e_missing_dict_colon), *arg);
return FAIL;
}
-
whitep = *arg + 1;
*arg = skipwhite(*arg + 1);
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{
--- 2593,2613 ----
}
}

if (**arg != ':')
{
! if (*skipwhite(*arg) == ':')
! semsg(_(e_no_white_before), ":");
! else
! semsg(_(e_missing_dict_colon), *arg);
return FAIL;
}
whitep = *arg + 1;
+ if (!IS_WHITE_OR_NUL(*whitep))
+ {
+ semsg(_(e_white_after), ":");
+ return FAIL;
+ }
+
*arg = skipwhite(*arg + 1);
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{
*** ../vim-8.2.1428/src/testdir/test_vim9_expr.vim 2020-08-12 15:21:18.970700474 +0200
--- src/testdir/test_vim9_expr.vim 2020-08-12 17:34:23.423557406 +0200
***************
*** 1494,1499 ****
--- 1494,1503 ----
mixed = #{a: 234}
mixed = #{}

+ call CheckDefFailure(["let x = #{a:8}"], 'E1069:')
+ call CheckDefFailure(["let x = #{a : 8}"], 'E1068:')
+ call CheckDefFailure(["let x = #{a :8}"], 'E1068:')
+
call CheckDefFailure(["let x = #{8: 8}"], 'E1014:')
call CheckDefFailure(["let x = #{xxx}"], 'E720:')
call CheckDefFailure(["let x = #{xxx: 1", "let y = 2"], 'E722:')
*** ../vim-8.2.1428/src/testdir/test_vim9_func.vim 2020-08-12 14:21:06.263590410 +0200
--- src/testdir/test_vim9_func.vim 2020-08-12 17:35:07.019332614 +0200
***************
*** 774,780 ****
enddef

def RetListAny(): list<any>
! return items({'k' : 'v'})
enddef

def RetListString(): list<string>
--- 774,780 ----
enddef

def RetListAny(): list<any>
! return items({'k': 'v'})
enddef

def RetListString(): list<string>
*** ../vim-8.2.1428/src/version.c 2020-08-12 16:38:07.267186093 +0200
--- src/version.c 2020-08-12 17:35:49.695112811 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1429,
/**/

--
hundred-and-one symptoms of being an internet addict:
180. You maintain more than six e-mail addresses.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages