forked from aniani/vim
patch 8.2.0717: Vim9: postponed constant expressions does not scale
Problem: Vim9: postponed constant expressions does not scale. Solution: Add a structure to pass around postponed constants.
This commit is contained in:
@@ -1039,12 +1039,22 @@ def s:ConcatStrings(): string
|
||||
return 'one' .. 'two' .. 'three'
|
||||
enddef
|
||||
|
||||
def s:ComputeConst(): number
|
||||
return 2 + 3 * 4 / 6 + 7
|
||||
enddef
|
||||
|
||||
def Test_simplify_const_expr()
|
||||
let res = execute('disass s:ConcatStrings')
|
||||
assert_match('\<SNR>\d*_ConcatStrings.*' ..
|
||||
'\d PUSHS "onetwothree".*' ..
|
||||
'\d RETURN',
|
||||
res)
|
||||
|
||||
res = execute('disass s:ComputeConst')
|
||||
assert_match('\<SNR>\d*_ComputeConst.*' ..
|
||||
'\d PUSHNR 11.*' ..
|
||||
'\d RETURN',
|
||||
res)
|
||||
enddef
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
||||
Reference in New Issue
Block a user