Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {!type:…} annot in docs to help odoc with ambiguities #296

Merged
merged 2 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Next release
------------------

* atdgen: use odoc syntax to disambiguate clashing names (#296).

2.7.0 (2022-05-17)
------------------

Expand Down
12 changes: 6 additions & 6 deletions atdgen/src/ob_emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ val %s_tag : Bi_io.node_tag
bprintf buf "\
val write_untagged_%s :%s
Bi_outbuf.t -> %s -> unit
(** Output an untagged biniou value of type {!%s}. *)
(** Output an untagged biniou value of type {!type:%s}. *)

" x.def_name writer_params full_name x.def_name;

bprintf buf "\
val write_%s :%s
Bi_outbuf.t -> %s -> unit
(** Output a biniou value of type {!%s}. *)
(** Output a biniou value of type {!type:%s}. *)

" x.def_name writer_params full_name x.def_name;

bprintf buf "\
val string_of_%s :%s
?len:int -> %s -> string
(** Serialize a value of type {!%s} into
(** Serialize a value of type {!type:%s} into
a biniou string. *)

" x.def_name writer_params full_name x.def_name;
Expand All @@ -81,21 +81,21 @@ val string_of_%s :%s
val get_%s_reader :%s
Bi_io.node_tag -> (Bi_inbuf.t -> %s)
(** Return a function that reads an untagged
biniou value of type {!%s}. *)
biniou value of type {!type:%s}. *)

" x.def_name reader_params full_name x.def_name;

bprintf buf "\
val read_%s :%s
Bi_inbuf.t -> %s
(** Input a tagged biniou value of type {!%s}. *)
(** Input a tagged biniou value of type {!type:%s}. *)

" x.def_name reader_params full_name x.def_name;

bprintf buf "\
val %s_of_string :%s
?pos:int -> string -> %s
(** Deserialize a biniou value of type {!%s}.
(** Deserialize a biniou value of type {!type:%s}.
@param pos specifies the position where
reading starts. Default: 0. *)

Expand Down
8 changes: 4 additions & 4 deletions atdgen/src/oj_emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let make_ocaml_json_intf ~with_create buf deref defs =
bprintf buf "\
val write_%s :%s
Bi_outbuf.t -> %s -> unit
(** Output a JSON value of type {!%s}. *)
(** Output a JSON value of type {!type:%s}. *)

"
s writer_params
Expand All @@ -69,7 +69,7 @@ val write_%s :%s
bprintf buf "\
val string_of_%s :%s
?len:int -> %s -> string
(** Serialize a value of type {!%s}
(** Serialize a value of type {!type:%s}
into a JSON string.
@param len specifies the initial length
of the buffer used internally.
Expand All @@ -83,7 +83,7 @@ val string_of_%s :%s
bprintf buf "\
val read_%s :%s
Yojson.Safe.lexer_state -> Lexing.lexbuf -> %s
(** Input JSON data of type {!%s}. *)
(** Input JSON data of type {!type:%s}. *)

"
s reader_params
Expand All @@ -93,7 +93,7 @@ val read_%s :%s
bprintf buf "\
val %s_of_string :%s
string -> %s
(** Deserialize JSON data of type {!%s}. *)
(** Deserialize JSON data of type {!type:%s}. *)

"
s reader_params
Expand Down
2 changes: 1 addition & 1 deletion atdgen/src/ov_emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let make_ocaml_validate_intf ~with_create buf deref defs =
bprintf buf "\
val validate_%s :%s
Atdgen_runtime.Util.Validation.path -> %s -> Atdgen_runtime.Util.Validation.error option
(** Validate a value of type {!%s}. *)
(** Validate a value of type {!type:%s}. *)

"
s validator_params
Expand Down
2 changes: 1 addition & 1 deletion atdgen/src/ox_emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ let make_record_creator deref x =
sprintf "\
val create_%s :%s
unit -> %s
(** Create a record of type {!%s}. *)
(** Create a record of type {!type:%s}. *)

"
s (String.concat "" intf_params)
Expand Down
Loading