Skip to content

Commit

Permalink
typ_to_var_name
Browse files Browse the repository at this point in the history
  • Loading branch information
reduction-choi committed Jul 31, 2024
1 parent bb5468a commit 624b791
Show file tree
Hide file tree
Showing 2 changed files with 417 additions and 1,925 deletions.
15 changes: 2 additions & 13 deletions spectec/src/il2al/translate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -543,21 +543,10 @@ let lhs_id_ref = ref 0
(* let lhs_prefix = "y_" *)
let init_lhs_id () = lhs_id_ref := 0
let get_lhs_name e =
<<<<<<< HEAD
let lhs_id = !lhs_id_ref in
lhs_id_ref := (lhs_id + 1);
varE ((typ_to_var_name e.note) ^ "_" ^ (lhs_id |> string_of_int))
=======
let rec variable_name_of_typ typ =
match typ.it with
| Il.Ast.VarT (id, _) -> id.it
| Il.Ast.IterT (typ', _) -> variable_name_of_typ typ'
| _ -> Il.Print.string_of_typ typ
in
let lhs_id = !lhs_id_ref in
lhs_id_ref := lhs_id + 1;
varE (variable_name_of_typ e.note ^ "_" ^ string_of_int lhs_id) ~note:e.note
>>>>>>> ec4a81c843f9d4ede62e429d3c4ff8f00170c1b5
varE (typ_to_var_name e.note ^ "_" ^ string_of_int lhs_id) ~note:e.note


(* Helper functions *)
let rec contains_name e = match e.it with
Expand Down
Loading

0 comments on commit 624b791

Please sign in to comment.