mirror of
https://github.com/bloeys/cogo.git
synced 2025-12-29 08:58:19 +00:00
86 lines
1.1 KiB
Go
Executable File
86 lines
1.1 KiB
Go
Executable File
// Code generated by 'cogo'; DO NOT EDIT.
|
|
package main
|
|
|
|
import "github.com/bloeys/cogo/cogo"
|
|
|
|
func test_cogo(c *cogo.Coroutine[int, int]) (out int) {
|
|
switch c.State {
|
|
case 0:
|
|
switch c.SubState {
|
|
default:
|
|
}
|
|
|
|
println("\nTick 1")
|
|
c.State++
|
|
c.SubState = -1
|
|
return 1
|
|
case 1:
|
|
switch c.SubState {
|
|
default:
|
|
case 1299498081:
|
|
goto cogo_1299498081
|
|
case 2020727887:
|
|
goto cogo_2020727887
|
|
}
|
|
|
|
{
|
|
println("\nInside block 1")
|
|
{
|
|
c.State = 1
|
|
c.SubState = 1299498081
|
|
return -20
|
|
}
|
|
}
|
|
cogo_1299498081:
|
|
;
|
|
|
|
if c.In > 1 {
|
|
println("\nInside if 1")
|
|
{
|
|
c.State = 1
|
|
c.SubState = 2020727887
|
|
return c.In
|
|
}
|
|
}
|
|
cogo_2020727887:
|
|
;
|
|
|
|
println("\nTick 2")
|
|
c.State++
|
|
c.SubState = -1
|
|
return 2
|
|
case 2:
|
|
switch c.SubState {
|
|
default:
|
|
}
|
|
|
|
println("\nTick 3")
|
|
c.State++
|
|
c.SubState = -1
|
|
return 3
|
|
case 3:
|
|
switch c.SubState {
|
|
default:
|
|
}
|
|
|
|
println("\nTick 4")
|
|
c.State++
|
|
c.SubState = -1
|
|
return 4
|
|
case 4:
|
|
switch c.SubState {
|
|
default:
|
|
}
|
|
c.State = -1
|
|
c.SubState = -1
|
|
|
|
println("\nTick before end")
|
|
|
|
return out
|
|
default:
|
|
c.State = -1
|
|
c.SubState = -1
|
|
return
|
|
}
|
|
}
|