mirror of
https://github.com/ParkerTenBroeck/coroutines.git
synced 2026-06-07 05:08:51 -04:00
separated functionality of generator state machine builders into separate classes
This commit is contained in:
parent
10d07e2c80
commit
c3cb7cb884
7 changed files with 449 additions and 285 deletions
|
|
@ -17,8 +17,7 @@ public interface Gen<Y, R> {
|
|||
default R await(){
|
||||
while(true){
|
||||
var res = next();
|
||||
if(res instanceof Ret(R r))return r;
|
||||
Gen.yield();
|
||||
if(res instanceof Ret r)return (R)r.v;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue