summaryrefslogtreecommitdiff
path: root/compiler/Cps.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--compiler/Cps.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/Cps.ml b/compiler/Cps.ml
index dc51c614..a013003e 100644
--- a/compiler/Cps.ml
+++ b/compiler/Cps.ml
@@ -16,16 +16,22 @@ type statement_eval_res =
| Continue of int
| Return
| Panic
- | EndEnterLoop
+ | LoopReturn (** We reached a return statement *while inside a loop* *)
+ | EndEnterLoop of V.typed_value list
(** When we enter a loop, we delegate the end of the function is
synthesized with a call to the loop translation. We use this
evaluation result to transmit the fact that we end evaluation
because we entered a loop.
+
+ We provide the list of values for the translated loop function call.
*)
- | EndContinue
+ | EndContinue of V.typed_value list
(** For loop translations: we end with a continue (i.e., a recursive call
to the translation for the loop body).
+
+ We provide the list of values for the translated loop function call.
*)
+[@@deriving show]
type eval_result = SA.expression option