summaryrefslogtreecommitdiff
path: root/src/Print.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/Print.ml
parent449c2cef40e1e255666c5564476007027b1a9b21 (diff)
Update the name definition to use path_elem
Diffstat (limited to 'src/Print.ml')
-rw-r--r--src/Print.ml14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Print.ml b/src/Print.ml
index f8b8ff85..e03efd94 100644
--- a/src/Print.ml
+++ b/src/Print.ml
@@ -11,13 +11,15 @@ module M = Modules
let option_to_string (to_string : 'a -> string) (x : 'a option) : string =
match x with Some x -> "Some (" ^ to_string x ^ ")" | None -> "None"
-let name_to_string (name : name) : string = String.concat "::" name
+let path_elem_to_string (pe : path_elem) : string =
+ match pe with
+ | Ident s -> s
+ | Disambiguator d -> "{" ^ Disambiguator.to_string d ^ "}"
-let fun_name_to_string (name : fun_name) : string =
- match name with
- | Regular name -> name_to_string name
- | Impl (type_name, impl_id, ident) ->
- name_to_string type_name ^ "{" ^ ImplId.to_string impl_id ^ "}::" ^ ident
+let name_to_string (name : name) : string =
+ String.concat "::" (List.map path_elem_to_string name)
+
+let fun_name_to_string (name : fun_name) : string = name_to_string name
(** Pretty-printing for types *)
module Types = struct