Patch 8.2.1431
Problem: Vim9: no error for white space before comma in dict.
Solution: Check for extra white space. (closes #6674)
Files: src/vim9compile.c, src/dict.c, src/testdir/test_vim9_expr.vim
*** ../vim-8.2.1430/src/vim9compile.c 2020-08-12 18:01:48.630628384 +0200
--- src/vim9compile.c 2020-08-12 18:29:41.081969734 +0200
***************
*** 2638,2643 ****
--- 2638,2648 ----
semsg(_(e_missing_dict_comma), *arg);
goto failret;
}
+ if (IS_WHITE_OR_NUL(*whitep))
+ {
+ semsg(_(e_no_white_before), ",");
+ return FAIL;
+ }
whitep = *arg + 1;
*arg = skipwhite(*arg + 1);
}
*** ../vim-8.2.1430/src/dict.c 2020-08-12 18:01:48.630628384 +0200
--- src/dict.c 2020-08-12 18:33:42.996715250 +0200
***************
*** 922,928 ****
if (!had_comma)
{
if (evaluate)
! semsg(_(e_missing_dict_comma), *arg);
goto failret;
}
}
--- 922,933 ----
if (!had_comma)
{
if (evaluate)
! {
! if (**arg == ',')
! semsg(_(e_no_white_before), ",");
! else
! semsg(_(e_missing_dict_comma), *arg);
! }
goto failret;
}
}
*** ../vim-8.2.1430/src/testdir/test_vim9_expr.vim 2020-08-12
18:01:48.630628384 +0200
--- src/testdir/test_vim9_expr.vim 2020-08-12 18:32:16.645163219 +0200
***************
*** 1506,1511 ****
--- 1506,1512 ----
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 = #{a: 8 , b: 9}"], 'E1068:')
call CheckDefFailure(["let x = #{8: 8}"], 'E1014:')
call CheckDefFailure(["let x = #{xxx}"], 'E720:')
***************
*** 1577,1582 ****
--- 1578,1589 ----
let d = #{one:1}
END
CheckScriptFailure(lines, 'E1069:')
+
+ lines =<< trim END
+ vim9script
+ let d = #{one: 1 , two: 2}
+ END
+ CheckScriptFailure(lines, 'E1068:')
enddef
let g:oneString = 'one'
*** ../vim-8.2.1430/src/version.c 2020-08-12 18:01:48.630628384 +0200
--- src/version.c 2020-08-12 18:30:58.717567337 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1431,
/**/
--
Wizards had always known that the act of observation changed the thing that
was observed, and sometimes forgot that it also changed the observer too.
Terry Pratchett - Interesting times
/// 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/202008121635.07CGZBcd096466%40masaka.moolenaar.net.