Skip to content

Commit

Permalink
Change function naming in translate.ml
Browse files Browse the repository at this point in the history
  • Loading branch information
presenthee committed Feb 5, 2024
1 parent 94df799 commit 7db9382
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 164 deletions.
8 changes: 4 additions & 4 deletions spectec/src/backend-prose/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ let transpile_expr =
post_expr = Il2al.Transpile.simplify_record_concat
}

let exp_to_expr e = exp2expr e |> transpile_expr
let exp_to_args es = exp2args es |> List.map transpile_expr
let exp_to_expr e = exp_to_expr e |> transpile_expr
let exp_to_args es = exp_to_args es |> List.map transpile_expr

let rec if_expr_to_instrs e =
let fail _ =
Expand All @@ -44,7 +44,7 @@ let rec if_expr_to_instrs e =
IfI (isDefinedE (varE name), body)
| _ -> fail() ]
| Ast.BinE (Ast.EquivOp, e1, e2) ->
[ EquivI (exp2expr e1, exp2expr e2) ]
[ EquivI (exp_to_expr e1, exp_to_expr e2) ]
| _ -> [ fail() ]

let rec prem_to_instrs prem = match prem.it with
Expand Down Expand Up @@ -87,7 +87,7 @@ let vrule_group_to_prose ((_name, vrules): vrule_group) =
| Ast.CaseE (Ast.Atom winstr_name, _) -> winstr_name
| _ -> failwith "unreachable"
in
let name = name2kwd winstr_name winstr.note in
let name = name_to_kwd winstr_name winstr.note in
(* params *)
let params = get_params winstr |> List.map exp_to_expr in
(* body *)
Expand Down
Loading

0 comments on commit 7db9382

Please sign in to comment.