@@ -31,8 +31,7 @@ let rec map_galaxy env ~f : galaxy -> (galaxy, err) Result.t = function
3131 in
3232 Galaxy g' |> Result. return
3333
34- and map_galaxy_expr env ~f e : (galaxy_expr, err) Result.t =
35- match e with
34+ and map_galaxy_expr env ~f : galaxy_expr -> (galaxy_expr , err ) Result. t = function
3635 | Raw g ->
3736 let * map_g = map_galaxy env ~f g in
3837 Raw map_g |> Result. return
@@ -48,6 +47,9 @@ and map_galaxy_expr env ~f e : (galaxy_expr, err) Result.t =
4847 | Exec e ->
4948 let * map_e = map_galaxy_expr env ~f e in
5049 Exec map_e |> Result. return
50+ | LinExec e ->
51+ let * map_e = map_galaxy_expr env ~f e in
52+ LinExec map_e |> Result. return
5153 | Union (e , e' ) ->
5254 let * map_e = map_galaxy_expr env ~f e in
5355 let * map_e' = map_galaxy_expr env ~f e' in
@@ -86,6 +88,9 @@ let rec replace_id env (_from : ident) (_to : galaxy_expr) e :
8688 | Exec e ->
8789 let * g = replace_id env _from _to e in
8890 Exec g |> Result. return
91+ | LinExec e ->
92+ let * g = replace_id env _from _to e in
93+ LinExec g |> Result. return
8994 | Union (e1 , e2 ) ->
9095 let * g1 = replace_id env _from _to e1 in
9196 let * g2 = replace_id env _from _to e2 in
@@ -200,7 +205,15 @@ and eval_galaxy_expr ~notyping (env : env) :
200205 let * eval_e = eval_galaxy_expr ~notyping env e in
201206 let * mcs = galaxy_to_constellation ~notyping env eval_e in
202207 begin
203- match exec ~showtrace: false mcs with
208+ match exec ~linear: false ~showtrace: false mcs with
209+ | Ok mcs -> Ok (Const (unmark_all mcs))
210+ | Error e -> Error (LscError e)
211+ end
212+ | LinExec e ->
213+ let * eval_e = eval_galaxy_expr ~notyping env e in
214+ let * mcs = galaxy_to_constellation ~notyping env eval_e in
215+ begin
216+ match exec ~linear: true ~showtrace: false mcs with
204217 | Ok mcs -> Ok (Const (unmark_all mcs))
205218 | Error e -> Error (LscError e)
206219 end
0 commit comments