Skip to content

Commit 763625e

Browse files
committed
dune fmt
1 parent 96ac5c7 commit 763625e

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

src/stellogen/sgen_ast.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ type env =
5151

5252
let expect (g : galaxy_expr) : galaxy_expr =
5353
Raw
54-
(Galaxy [ GLabelDef (const "interaction", Id (const "tested")); GLabelDef (const "expect", g) ])
54+
(Galaxy
55+
[ GLabelDef (const "interaction", Id (const "tested"))
56+
; GLabelDef (const "expect", g)
57+
] )
5558

5659
let initial_env =
5760
{ objs = [ (const "^empty", Raw (Const [])) ]

src/stellogen/sgen_eval.ml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ let subst_vars env _from _to =
113113
let subst_funcs env _from _to =
114114
map_galaxy_expr env ~f:(subst_all_funcs [ (_from, _to) ])
115115

116-
let group_galaxy : galaxy_declaration list -> type_declaration list * (StellarRays.term * galaxy_expr) list =
117-
List.fold_left ~init:([], []) ~f:(function types, fields -> function
116+
let group_galaxy :
117+
galaxy_declaration list
118+
-> type_declaration list * (StellarRays.term * galaxy_expr) list =
119+
List.fold_left ~init:([], []) ~f:(function types, fields ->
120+
(function
118121
| GTypeDef d -> (d :: types, fields)
119-
| GLabelDef (x, g') -> (types, (x, g') :: fields) )
122+
| GLabelDef (x, g') -> (types, (x, g') :: fields) ) )
120123

121124
let rec typecheck_galaxy ~notyping env (g : galaxy_declaration list) :
122125
(unit, err) Result.t =
@@ -230,7 +233,8 @@ and eval_galaxy_expr ~notyping (env : env) :
230233
List.fold_left t ~init:(Ok init) ~f:(fun acc x ->
231234
let* acc = acc in
232235
match x with
233-
| Id (Func ((Muted, (Null, "kill")), [])) -> acc |> remove_mark_all |> kill |> focus |> Result.return
236+
| Id (Func ((Muted, (Null, "kill")), [])) ->
237+
acc |> remove_mark_all |> kill |> focus |> Result.return
234238
| Id (Func ((Muted, (Null, "clean")), [])) ->
235239
acc |> remove_mark_all |> clean |> focus |> Result.return
236240
| _ ->
@@ -298,7 +302,8 @@ and check_interface ~notyping env x i =
298302
let type_decls = List.map i ~f:(fun t -> GTypeDef t) in
299303
typecheck_galaxy ~notyping env (type_decls @ g)
300304

301-
and typecheck ~notyping env x (t : StellarRays.term) (ck : galaxy_expr) : (unit, err) Result.t =
305+
and typecheck ~notyping env x (t : StellarRays.term) (ck : galaxy_expr) :
306+
(unit, err) Result.t =
302307
let* gtests : (StellarRays.term * galaxy_expr) list =
303308
match get_obj env t with
304309
| Some (Raw (Const mcs)) -> Ok [ (const "_", Raw (Const mcs)) ]
@@ -343,7 +348,15 @@ and typecheck ~notyping env x (t : StellarRays.term) (ck : galaxy_expr) : (unit,
343348
| Ok (idtest, got) ->
344349
let* got = got in
345350
let* eq = equal_galaxy ~notyping env got eval_exp in
346-
if not eq then Error (TestFailed (string_of_ray x, string_of_ray t, string_of_ray idtest, got, eval_exp)) else Ok ()
351+
if not eq then
352+
Error
353+
(TestFailed
354+
( string_of_ray x
355+
, string_of_ray t
356+
, string_of_ray idtest
357+
, got
358+
, eval_exp ) )
359+
else Ok ()
347360
| Error e -> Error e )
348361
|> Result.all_unit
349362

@@ -368,7 +381,9 @@ and string_of_type_declaration ~notyping env = function
368381
let str_x = string_of_ray x in
369382
let str_xck = string_of_ray xck in
370383
let str_ts = List.map ts ~f:string_of_ray in
371-
Printf.sprintf " %s :: %s [%s].\n" str_x (string_of_list Fn.id "," str_ts) str_xck
384+
Printf.sprintf " %s :: %s [%s].\n" str_x
385+
(string_of_list Fn.id "," str_ts)
386+
str_xck
372387
| TExp (x, g) -> (
373388
match eval_galaxy_expr ~notyping env g with
374389
| Error _ -> failwith "Error: string_of_type_declaration"

0 commit comments

Comments
 (0)