Patch 8.2.2262
Problem: Vim9: converting bool to string prefixes v:.
Solution: Do not use the v: prefix.
Files: src/evalvars.c, src/testdir/test_vim9_expr.vim,
src/testdir/test_vim9_disassemble.vim
*** ../vim-8.2.2261/src/evalvars.c 2020-12-31 17:40:57.536087870 +0100
--- src/evalvars.c 2021-01-01 14:57:38.383405743 +0100
***************
*** 2068,2075 ****
{
switch (nr)
{
! case VVAL_FALSE: return "v:false";
! case VVAL_TRUE: return "v:true";
case VVAL_NONE: return "v:none";
case VVAL_NULL: return "v:null";
}
--- 2068,2075 ----
{
switch (nr)
{
! case VVAL_FALSE: return in_vim9script() ? "false" : "v:false";
! case VVAL_TRUE: return in_vim9script() ? "true" : "v:true";
case VVAL_NONE: return "v:none";
case VVAL_NULL: return "v:null";
}
*** ../vim-8.2.2261/src/testdir/test_vim9_expr.vim 2021-01-01
14:49:11.908956386 +0100
--- src/testdir/test_vim9_expr.vim 2021-01-01 15:02:47.750389720 +0100
***************
*** 1056,1069 ****
assert_equal('123 hello', 123 .. ' hello')
assert_equal('123456', 123 .. 456)
! assert_equal('av:true', 'a' .. true)
! assert_equal('av:false', 'a' .. false)
assert_equal('av:null', 'a' .. v:null)
assert_equal('av:none', 'a' .. v:none)
if has('float')
assert_equal('a0.123', 'a' .. 0.123)
endif
assert_equal([1, 2, 3, 4], [1, 2] + [3, 4])
assert_equal(0z11223344, 0z1122 + 0z3344)
assert_equal(0z112201ab, 0z1122
--- 1056,1074 ----
assert_equal('123 hello', 123 .. ' hello')
assert_equal('123456', 123 .. 456)
! assert_equal('atrue', 'a' .. true)
! assert_equal('afalse', 'a' .. false)
assert_equal('av:null', 'a' .. v:null)
assert_equal('av:none', 'a' .. v:none)
if has('float')
assert_equal('a0.123', 'a' .. 0.123)
endif
+ set digraph
+ assert_equal('val: true', 'val: ' .. &digraph)
+ set nodigraph
+ assert_equal('val: false', 'val: ' .. &digraph)
+
assert_equal([1, 2, 3, 4], [1, 2] + [3, 4])
assert_equal(0z11223344, 0z1122 + 0z3344)
assert_equal(0z112201ab, 0z1122
*** ../vim-8.2.2261/src/testdir/test_vim9_disassemble.vim 2020-12-31
21:28:43.423217932 +0100
--- src/testdir/test_vim9_disassemble.vim 2021-01-01 15:04:35.814028236
+0100
***************
*** 182,188 ****
var res = execute('disass s:ScriptFuncPush')
assert_match('<SNR>\d*_ScriptFuncPush.*' ..
'localbool = true.*' ..
! ' PUSH v:true.*' ..
'localspec = v:none.*' ..
' PUSH v:none.*' ..
'localblob = 0z1234.*' ..
--- 182,188 ----
var res = execute('disass s:ScriptFuncPush')
assert_match('<SNR>\d*_ScriptFuncPush.*' ..
'localbool = true.*' ..
! ' PUSH true.*' ..
'localspec = v:none.*' ..
' PUSH v:none.*' ..
'localblob = 0z1234.*' ..
***************
*** 1461,1467 ****
var instr = execute('disassemble InvertBool')
assert_match('InvertBool\_s*' ..
'var flag = true\_s*' ..
! '\d PUSH v:true\_s*' ..
'\d STORE $0\_s*' ..
'var invert = !flag\_s*' ..
'\d LOAD $0\_s*' ..
--- 1461,1467 ----
var instr = execute('disassemble InvertBool')
assert_match('InvertBool\_s*' ..
'var flag = true\_s*' ..
! '\d PUSH true\_s*' ..
'\d STORE $0\_s*' ..
'var invert = !flag\_s*' ..
'\d LOAD $0\_s*' ..
*** ../vim-8.2.2261/src/version.c 2021-01-01 14:49:11.908956386 +0100
--- src/version.c 2021-01-01 14:58:45.631187688 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2262,
/**/
--
Q: How many legs does a giraffe have?
A: Eight: two in front, two behind, two on the left and two on the right
/// 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/202101011412.101EC5s91536131%40masaka.moolenaar.net.