Debian Codegraph @

tests/snapshots/cli/stack-switching/cont.wast/57.print

raw
1 (module $co2
2 (type $task (;0;) (func (result i32)))
3 (type $ct (;1;) (cont $task))
4 (type (;2;) (func))
5 (type (;3;) (func (param (ref $ct) (ref $ct)) (result i32)))
6 (tag $pause (;0;) (type 2))
7 (tag $cancel (;1;) (type 2))
8 (export "pause" (tag 0))
9 (export "cancel" (tag 1))
10 (export "seesaw" (func $run))
11 (func $run (;0;) (type 3) (param $up (ref $ct)) (param $down (ref $ct)) (result i32)
12 (local $result i32)
13 loop $run_next (result i32)
14 block $on_pause (result (ref $ct))
15 local.get $up
16 resume $ct (on $pause $on_pause)
17 local.set $result
18 block $on_cancel
19 try_table (catch $cancel $on_cancel) ;; label = @4
20 local.get $down
21 resume_throw $ct $cancel
22 drop
23 end
24 end
25 local.get $result
26 return
27 end
28 local.set $up
29 local.get $down
30 local.get $up
31 local.set $down
32 local.set $up
33 br $run_next
34 end
35 )
36 )