comparison src/testdir/test_vim9_disassemble.vim @ 23156:6aa8ddf7a3fa v8.2.2124

patch 8.2.2124: Vim9: a range cannot be computed at runtime Commit: https://github.com/vim/vim/commit/08597875b2a1e7d118b0346c652a96e7527e7d8b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 10 19:43:40 2020 +0100 patch 8.2.2124: Vim9: a range cannot be computed at runtime Problem: Vim9: a range cannot be computed at runtime. Solution: Add the ISN_RANGE instruction.
author Bram Moolenaar <Bram@vim.org>
date Thu, 10 Dec 2020 19:45:04 +0100
parents 4b398a229b0b
children 4d5d12138b36
comparison
equal deleted inserted replaced
23155:1172003ef1bf 23156:6aa8ddf7a3fa
126 var res = execute('disass s:PutExpr') 126 var res = execute('disass s:PutExpr')
127 assert_match('<SNR>\d*_PutExpr.*' .. 127 assert_match('<SNR>\d*_PutExpr.*' ..
128 ' :3put ="text"\_s*' .. 128 ' :3put ="text"\_s*' ..
129 '\d PUSHS "text"\_s*' .. 129 '\d PUSHS "text"\_s*' ..
130 '\d PUT = 3\_s*' .. 130 '\d PUT = 3\_s*' ..
131 '\d PUSHNR 0\_s*' ..
132 '\d RETURN',
133 res)
134 enddef
135
136 def s:PutRange()
137 :$-2put a
138 enddef
139
140 def Test_disassemble_put_range()
141 var res = execute('disass s:PutRange')
142 assert_match('<SNR>\d*_PutRange.*' ..
143 ' :$-2put a\_s*' ..
144 '\d RANGE $-2\_s*' ..
145 '\d PUT a range\_s*' ..
131 '\d PUSHNR 0\_s*' .. 146 '\d PUSHNR 0\_s*' ..
132 '\d RETURN', 147 '\d RETURN',
133 res) 148 res)
134 enddef 149 enddef
135 150