Mercurial > vim
comparison src/testdir/test_vim9_disassemble.vim @ 25660:7b80b25a5c2b v8.2.3366
patch 8.2.3366: Vim9: debugging elseif does not stop before condition
Commit: https://github.com/vim/vim/commit/093165c899f1620543844d1c1a7a05975697c286
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 22 13:35:31 2021 +0200
patch 8.2.3366: Vim9: debugging elseif does not stop before condition
Problem: Vim9: debugging elseif does not stop before condition.
Solution: Move debug statement to after the jump. (closes https://github.com/vim/vim/issues/8781)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Aug 2021 13:45:04 +0200 |
parents | 27cb2e79ccde |
children | fe8d153cb268 |
comparison
equal
deleted
inserted
replaced
25659:eeb0364f03a2 | 25660:7b80b25a5c2b |
---|---|
2253 '\d PUSHS "done"\_s*' .. | 2253 '\d PUSHS "done"\_s*' .. |
2254 '\d RETURN\_s*', | 2254 '\d RETURN\_s*', |
2255 res) | 2255 res) |
2256 enddef | 2256 enddef |
2257 | 2257 |
2258 def s:DebugElseif() | |
2259 var b = false | |
2260 if b | |
2261 eval 1 + 0 | |
2262 silent elseif !b | |
2263 eval 2 + 0 | |
2264 endif | |
2265 enddef | |
2266 | |
2267 def Test_debug_elseif() | |
2268 var res = execute('disass debug s:DebugElseif') | |
2269 assert_match('<SNR>\d*_DebugElseif\_s*' .. | |
2270 'var b = false\_s*' .. | |
2271 '0 DEBUG line 1-1 varcount 0\_s*' .. | |
2272 '1 PUSH false\_s*' .. | |
2273 '2 STORE $0\_s*' .. | |
2274 | |
2275 'if b\_s*' .. | |
2276 '3 DEBUG line 2-2 varcount 1\_s*' .. | |
2277 '4 LOAD $0\_s*' .. | |
2278 '5 JUMP_IF_FALSE -> 10\_s*' .. | |
2279 | |
2280 'eval 1 + 0\_s*' .. | |
2281 '6 DEBUG line 3-3 varcount 1\_s*' .. | |
2282 '7 PUSHNR 1\_s*' .. | |
2283 '8 DROP\_s*' .. | |
2284 | |
2285 'silent elseif !b\_s*' .. | |
2286 '9 JUMP -> 20\_s*' .. | |
2287 '10 CMDMOD silent\_s*' .. | |
2288 '11 DEBUG line 4-4 varcount 1\_s*' .. | |
2289 '12 LOAD $0\_s*' .. | |
2290 '13 INVERT -1 (!val)\_s*' .. | |
2291 '14 CMDMOD_REV\_s*' .. | |
2292 '15 JUMP_IF_FALSE -> 20\_s*' .. | |
2293 | |
2294 'eval 2 + 0\_s*' .. | |
2295 '16 DEBUG line 5-5 varcount 1\_s*' .. | |
2296 '17 PUSHNR 2\_s*' .. | |
2297 '18 DROP\_s*' .. | |
2298 | |
2299 'endif\_s*' .. | |
2300 '19 DEBUG line 6-6 varcount 1\_s*' .. | |
2301 '20 RETURN void*', | |
2302 res) | |
2303 enddef | |
2304 | |
2258 def s:EchoMessages() | 2305 def s:EchoMessages() |
2259 echohl ErrorMsg | echom v:exception | echohl NONE | 2306 echohl ErrorMsg | echom v:exception | echohl NONE |
2260 enddef | 2307 enddef |
2261 | 2308 |
2262 def Test_disassemble_nextcmd() | 2309 def Test_disassemble_nextcmd() |