Skip to content

Commit

Permalink
compatibility with 4.02
Browse files Browse the repository at this point in the history
Signed-off-by: Paul-Elliot <[email protected]>
  • Loading branch information
panglesd committed Sep 12, 2023
1 parent cc3610b commit 701f2e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/ocamlary/ocamlary.mli
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ type variant =

(** This comment is for [poly_variant]. *)
type poly_variant =
[ `TagA (** This is a comment for [`TagA] *)
| `ConstrB of int (** This is a comment for [`ConstrB] *) ]
[ `TagA
(* This is a comment for [`TagA]. Disabled for compatibility
with 4.02. *)
| `ConstrB of int (* This is a comment for [`ConstrB] *) ]
(** Wow! It was a polymorphic variant! *)

(** This comment is for [full_gadt]. *)
Expand Down
8 changes: 0 additions & 8 deletions test/generators/html/Ocamlary.html
Original file line number Diff line number Diff line change
Expand Up @@ -1065,20 +1065,12 @@ <h4 id="advanced-type-stuff">
<li id="type-poly_variant.TagA" class="def variant constructor
anchored"><a href="#type-poly_variant.TagA" class="anchor"></a>
<code><span>| </span><span>`TagA</span></code>
<div class="def-doc"><span class="comment-delim">(*</span>
<p>This is a comment for <code>`TagA</code></p>
<span class="comment-delim">*)</span>
</div>
</li>
<li id="type-poly_variant.ConstrB" class="def variant constructor
anchored"><a href="#type-poly_variant.ConstrB" class="anchor"></a>
<code><span>| </span>
<span>`ConstrB <span class="keyword">of</span> int</span>
</code>
<div class="def-doc"><span class="comment-delim">(*</span>
<p>This is a comment for <code>`ConstrB</code></p>
<span class="comment-delim">*)</span>
</div>
</li>
</ol><code><span> ]</span></code>
</div>
Expand Down
4 changes: 2 additions & 2 deletions test/generators/latex/Ocamlary.tex
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ \subsubsection{Advanced Type Stuff\label{advanced-type-stuff}}%
\begin{ocamlindent}This comment is for \ocamlinlinecode{variant}.This comment is also for \ocamlinlinecode{variant}.\end{ocamlindent}%
\medbreak
\label{module-Ocamlary-type-poly_variant}\ocamlcodefragment{\ocamltag{keyword}{type} poly\_\allowbreak{}variant = [ }\\
\begin{ocamltabular}{p{0.500\textwidth}p{0.500\textwidth}}\ocamlcodefragment{| `TagA}\label{module-Ocamlary-type-poly_variant.TagA}& This is a comment for \ocamlinlinecode{`TagA}\\
\ocamlcodefragment{| `ConstrB \ocamltag{keyword}{of} int}\label{module-Ocamlary-type-poly_variant.ConstrB}& This is a comment for \ocamlinlinecode{`ConstrB}\\
\begin{ocamltabular}{p{1.000\textwidth}}\ocamlcodefragment{| `TagA}\label{module-Ocamlary-type-poly_variant.TagA}\\
\ocamlcodefragment{| `ConstrB \ocamltag{keyword}{of} int}\label{module-Ocamlary-type-poly_variant.ConstrB}\\
\end{ocamltabular}%
\\
\ocamlcodefragment{ ]}\begin{ocamlindent}This comment is for \ocamlinlinecode{poly\_\allowbreak{}variant}.Wow! It was a polymorphic variant!\end{ocamlindent}%
Expand Down
6 changes: 0 additions & 6 deletions test/generators/man/Ocamlary.3o
Original file line number Diff line number Diff line change
Expand Up @@ -1224,14 +1224,8 @@ This comment is also for variant\.
.ti +2
| `TagA
.br
.ti +4
(* This is a comment for `TagA *)
.br
.ti +2
| `ConstrB \f[CB]of\fR int
.br
.ti +4
(* This is a comment for `ConstrB *)
.br
]
.fi
Expand Down

0 comments on commit 701f2e9

Please sign in to comment.