feat: allow yielding main fiber and expose current fiber reference
- Change Fiber.yield() to exit interpreter when no parent fiber exists instead of raising runtime error - Add Fiber.current primitive to return the currently executing fiber object - Update interpreter loop to stop execution when PRIM_RUN_FIBER receives null value - Modify test expectations to reflect new yielding behavior from main fiber
This commit is contained in:
@@ -1 +1,3 @@
|
||||
Fiber.yield(1) // expect runtime error: No fiber to yield to.
|
||||
IO.print("before") // expect: before
|
||||
Fiber.yield(1)
|
||||
IO.print("not reached")
|
||||
Reference in New Issue
Block a user