Skip to content

Commit c1dd82e

Browse files
committed
Renamed to_ast and of_ast to unwrap and wrap.
1 parent 9a30511 commit c1dd82e

File tree

11 files changed

+270
-270
lines changed

11 files changed

+270
-270
lines changed

ast/cinaps/gen_versions.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ module Structure = struct
257257
Print.println "let to_concrete_opt t =";
258258
Print.indented (fun () ->
259259
Print.println
260-
"match Node.to_ast (Unversioned.Private.transparent t) ~version with";
260+
"match Node.unwrap (Unversioned.Private.transparent t) ~version with";
261261
Print.println "| { name = %S; data } -> %s data"
262262
node_name
263263
(ast_to_ty ~grammar ty);
@@ -266,7 +266,7 @@ module Structure = struct
266266
Print.println "let to_concrete_opt t =";
267267
Print.indented (fun () ->
268268
Print.println
269-
"match Node.to_ast (Unversioned.Private.transparent t) ~version with";
269+
"match Node.unwrap (Unversioned.Private.transparent t) ~version with";
270270
Print.println "| { name = %S" node_name;
271271
Print.indented (fun () ->
272272
Print.println "; data = Record [| %s |]"
@@ -283,7 +283,7 @@ module Structure = struct
283283
Print.println "let to_concrete_opt t =";
284284
Print.indented (fun () ->
285285
Print.println
286-
"match Node.to_ast (Unversioned.Private.transparent t) ~version with";
286+
"match Node.unwrap (Unversioned.Private.transparent t) ~version with";
287287
Print.println "| { name = %S; data } ->" node_name;
288288
Print.indented (fun () ->
289289
Print.println "begin";
@@ -411,7 +411,7 @@ let print_version_ml version =
411411
"let version = Astlib.Version.of_string %S"
412412
(Astlib.Version.to_string version);
413413
Print.println
414-
"let node name data = Unversioned.Private.opaque (Node.of_ast ~version { name; data })";
414+
"let node name data = Unversioned.Private.opaque (Node.wrap ~version { name; data })";
415415
Print.newline ();
416416
Ml.define_modules grammar ~f:(fun node_name kind ->
417417
match (kind : Astlib.Grammar.kind) with

ast/node.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type t = { version : Astlib.Version.t; ast : t Astlib.Ast.t }
22

33
let version t = t.version
44

5-
let of_ast ~version ast = { version; ast }
5+
let wrap ~version ast = { version; ast }
66

7-
let rec to_ast ~version:dst_version { ast; version = src_version } =
8-
Astlib.History.convert Astlib.history ast ~src_version ~dst_version ~to_ast ~of_ast
7+
let rec unwrap ~version:dst_version { ast; version = src_version } =
8+
Astlib.History.convert Astlib.history ast ~src_version ~dst_version ~unwrap ~wrap

ast/node.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type t
22

33
val version : t -> Astlib.Version.t
4-
val of_ast : version:Astlib.Version.t -> t Astlib.Ast.t -> t
5-
val to_ast : version:Astlib.Version.t -> t -> t Astlib.Ast.t
4+
val wrap : version:Astlib.Version.t -> t Astlib.Ast.t -> t
5+
val unwrap : version:Astlib.Version.t -> t -> t Astlib.Ast.t

0 commit comments

Comments
 (0)