mirror of
https://github.com/ParkerTenBroeck/coroutines.git
synced 2026-06-07 05:08:51 -04:00
generalization
This commit is contained in:
parent
9b0a9b7ad2
commit
95e7f6a59e
8 changed files with 174 additions and 104 deletions
|
|
@ -81,11 +81,16 @@ public class GenSMBuilder extends StateMachineBuilder {
|
|||
smmap.put(new SpecialMethod(CD_Gen, "ret", MTD_Gen),(_, _) -> new RetHandler(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String uniqueName() {
|
||||
return "Gen"+super.uniqueName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildStateMachineMethod(ClassBuilder clb){
|
||||
clb.withInterfaces(List.of(clb.constantPool().classEntry(CD_Gen)));
|
||||
clb.withMethod("next", MethodTypeDesc.of(CD_Res), ClassFile.ACC_PUBLIC, mb -> mb.withCode(cob -> {
|
||||
buildStateMachineMethodCode(clb, cob);
|
||||
buildStateMachineMethodCode(clb, cob, 1);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue