summaryrefslogtreecommitdiff
path: root/src/ExtractToFStar.ml
diff options
context:
space:
mode:
authorSon Ho2022-03-03 12:13:02 +0100
committerSon Ho2022-03-03 12:13:02 +0100
commit4581c76ece9ba75dbd15e550c71d003ae2871901 (patch)
treeec941dba5f29abc087a2737bb5e5528bdfbfe229 /src/ExtractToFStar.ml
parent449c2cef40e1e255666c5564476007027b1a9b21 (diff)
Update the name definition to use path_elem
Diffstat (limited to 'src/ExtractToFStar.ml')
-rw-r--r--src/ExtractToFStar.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ExtractToFStar.ml b/src/ExtractToFStar.ml
index d8d14ddf..8bf02bd0 100644
--- a/src/ExtractToFStar.ml
+++ b/src/ExtractToFStar.ml
@@ -221,7 +221,7 @@ let mk_formatter (ctx : trans_ctx) (variant_concatenate_type_name : bool) :
*)
let get_type_name (name : name) : string =
match name with
- | [ _module; name ] -> name
+ | [ Ident _module; Ident name ] -> name
| _ ->
raise (Failure ("Unexpected name shape: " ^ Print.name_to_string name))
in
@@ -258,8 +258,9 @@ let mk_formatter (ctx : trans_ctx) (variant_concatenate_type_name : bool) :
*)
let get_fun_name (name : fun_name) : string =
match name with
- | Regular [ _module; name ] -> name
- | Impl ([ _module; ty ], _, name) -> to_snake_case ty ^ "_" ^ name
+ | [ Ident _module_name; Ident name ] -> name
+ | [ Ident _module_name; Ident ty; Disambiguator _; Ident name ] ->
+ to_snake_case ty ^ "_" ^ name
| _ ->
raise
(Failure ("Unexpected name shape: " ^ Print.fun_name_to_string name))
@@ -1098,8 +1099,8 @@ let extract_template_decreases_clause (ctx : extraction_ctx) (fmt : F.formatter)
it is useful for the decrease clause.
*)
let extract_fun_decl (ctx : extraction_ctx) (fmt : F.formatter)
- (qualif : fun_decl_qualif) (has_decreases_clause : bool) (fwd_def : fun_decl)
- (def : fun_decl) : unit =
+ (qualif : fun_decl_qualif) (has_decreases_clause : bool)
+ (fwd_def : fun_decl) (def : fun_decl) : unit =
(* Retrieve the function name *)
let def_name = ctx_get_local_function def.def_id def.back_id ctx in
(* (* Add the type parameters - note that we need those bindings only for the