Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 20336:2fd980fb9ab3 v8.2.0723
patch 8.2.0723: Vim9: nested constant expression not evaluated compile time
Commit: https://github.com/vim/vim/commit/1c74721233dac057778f9aef9ae20f49d934ec22
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 9 18:28:34 2020 +0200
patch 8.2.0723: Vim9: nested constant expression not evaluated compile time
Problem: Vim9: nested constant expression not evaluated compile time.
Solution: Use compile_expr1() for parenthesis.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 09 May 2020 18:30:03 +0200 |
parents | 445c2b2ea44b |
children | 7587d892c00c |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -1053,6 +1053,10 @@ def s:ComputeConst(): number return 2 + 3 * 4 / 6 + 7 enddef +def s:ComputeConstParen(): number + return ((2 + 4) * (8 / 2)) / (3 + 4) +enddef + def Test_simplify_const_expr() let res = execute('disass s:ConcatStrings') assert_match('\<SNR>\d*_ConcatStrings.*' .. @@ -1065,6 +1069,12 @@ def Test_simplify_const_expr() '\d PUSHNR 11.*' .. '\d RETURN', res) + + res = execute('disass s:ComputeConstParen') + assert_match('\<SNR>\d*_ComputeConstParen.*' .. + '\d PUSHNR 3\>.*' .. + '\d RETURN', + res) enddef " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker