Skip to content

Commit

Permalink
Merge pull request #296 from MisterDA/odoc-type-annot
Browse files Browse the repository at this point in the history
Add `{!type:…}` annot in docs to help odoc with ambiguities
  • Loading branch information
mjambon authored May 24, 2022
2 parents 242e3ec + 0dd0610 commit 65a4534
Show file tree
Hide file tree
Showing 14 changed files with 896 additions and 891 deletions.
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

0 comments on commit 65a4534

Please sign in to comment.