started implementing call-with-current-continuation

This commit is contained in:
2014-01-26 16:15:28 +00:00
parent 4208d8f2df
commit 11143203af
5 changed files with 140 additions and 28 deletions

View File

@ -178,6 +178,22 @@ procedure Execute (Interp: in out Interpreter_Record) is
Pop_Tops (Interp, 2);
end Finish_If_Syntax;
-- --------------------------------------------------------------------
procedure Do_Continuation_Finish is
pragma Inline (Do_Continuation_Finish);
C: Object_Pointer;
R: Object_Pointer;
begin
C := Get_Frame_Operand(Interp.Stack);
pragma Assert (Is_Continuation(C));
R := Get_Frame_Result(Interp.Stack);
Interp.Stack := Get_Continuation_Frame(C);
Set_Frame_Result (Interp.Stack, R);
ada.text_io.put_line ("resettting result");
print (interp, get_Frame_result(interp.stack));
end Do_Continuation_Finish;
-- --------------------------------------------------------------------
procedure Do_Let_Evaluation is
@ -950,6 +966,9 @@ begin
when Opcode_Finish_If_Syntax =>
Finish_If_Syntax; -- Conditional
when Opcode_Continuation_Finish =>
Do_Continuation_Finish;
when Opcode_Let_Binding =>
Do_Let_Binding;
when Opcode_Letast_Binding =>