Skip to content
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
2 changes: 1 addition & 1 deletion odoc-parser.opam
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev-repo: "git+https://github.com/ocaml/odoc.git"
doc: "https://ocaml.github.io/odoc/odoc_parser"
depends: [
"dune" {>= "3.7"}
"ocaml" {>= "4.02.0" & < "5.3"}
"ocaml" {>= "4.02.0" & < "5.4"}
"astring"
"result"
"camlp-streams"
Expand Down
2 changes: 1 addition & 1 deletion odoc.opam
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ depends: [
"cppo" {build & >= "1.1.0"}
"dune" {>= "3.7.0"}
"fpath"
"ocaml" {>= "4.02.0" & < "5.3"}
"ocaml" {>= "4.02.0" & < "5.4"}
"result"
"tyxml" {>= "4.4.0"}
"fmt"
Expand Down
1 change: 1 addition & 0 deletions src/syntax_highlighter/syntax_highlighter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ let tag_of_token (tok : Parser.token) =
#endif

let syntax_highlighting_locs src =
Lexer.init ();
let lexbuf = Lexing.from_string
#if OCAML_VERSION >= (4,8,0)
~with_positions:true
Expand Down
10 changes: 3 additions & 7 deletions test/generators/cases/alerts.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ val c : int
(* At the top-level of a module. *)

module Top1 : sig
[@@@deprecated "A"]

(** Top-comment. *)
end

module Top2 : sig
[@@@deprecated "A"]

(* On OCaml 4.04 to 4.06, this top-comment is lost by the parser if there's
no empty line before it. *)
(** Top-comment. *)
end
[@@deprecated "A"]

(* Deprecated alert tag. *)

Expand Down
4 changes: 2 additions & 2 deletions test/generators/html/Alerts-Top1.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<a href="Alerts.html">Alerts</a> &#x00BB; Top1
</nav>
<header class="odoc-preamble">
<h1>Module <code><span>Alerts.Top1</span></code></h1><p>Top-comment.</p>
<h1>Module <code><span>Alerts.Top1</span></code></h1>
<ul class="at-tags">
<li class="deprecated"><span class="at-tag">deprecated</span> A</li>
</ul>
</ul><p>Top-comment.</p>
</header><div class="odoc-content"></div>
</body>
</html>
21 changes: 0 additions & 21 deletions test/generators/html/Alerts-Top2.html

This file was deleted.

15 changes: 1 addition & 14 deletions test/generators/html/Alerts.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,7 @@ <h1>Module <code><span>Alerts</span></code></h1>
<span class="keyword">end</span>
</span>
</code>
</div><div class="spec-doc"><p>Top-comment.</p></div>
</div>
<div class="odoc-spec">
<div class="spec module anchored" id="module-Top2">
<a href="#module-Top2" class="anchor"></a>
<code>
<span><span class="keyword">module</span>
<a href="Alerts-Top2.html">Top2</a>
</span>
<span> : <span class="keyword">sig</span> ...
<span class="keyword">end</span>
</span>
</code>
</div><div class="spec-doc"><p>Top-comment.</p></div>
</div>
</div>
<div class="odoc-spec">
<div class="spec value anchored" id="val-d">
Expand Down
1 change: 0 additions & 1 deletion test/generators/html/alerts.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Alerts.html
Alerts-Top1.html
Alerts-Top2.html
6 changes: 1 addition & 5 deletions test/generators/latex/Alerts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ \section{Module \ocamlinlinecode{Alerts}}\label{module-Alerts}%
\end{ocamlindent}%
\medbreak
\label{module-Alerts-module-Top1}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[module-Alerts-module-Top1]{\ocamlinlinecode{Top1}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\end{ocamlindent}%
\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Top-comment.\end{ocamlindent}%
\medbreak
\label{module-Alerts-module-Top2}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[module-Alerts-module-Top2]{\ocamlinlinecode{Top2}}}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\end{ocamlindent}%
\ocamlcodefragment{\ocamltag{keyword}{end}}\begin{ocamlindent}Top-comment.\end{ocamlindent}%
\medbreak
\ocamlcodefragment{\ocamltag{keyword}{end}}\\
\label{module-Alerts-val-d}\ocamlcodefragment{\ocamltag{keyword}{val} d : int}\begin{ocamlindent}\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{deprecated}]{A deprecated alert d}\end{description}%
Expand Down
16 changes: 2 additions & 14 deletions test/generators/link.dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@
(subdir
html
(rule
(targets Alerts.html.gen Alerts-Top1.html.gen Alerts-Top2.html.gen)
(targets Alerts.html.gen Alerts-Top1.html.gen)
(action
(run
odoc
Expand All @@ -711,12 +711,6 @@
(alias runtest)
(action
(diff Alerts-Top1.html Alerts-Top1.html.gen))
(enabled_if
(>= %{ocaml_version} 4.04)))
(rule
(alias runtest)
(action
(diff Alerts-Top2.html Alerts-Top2.html.gen))
(enabled_if
(>= %{ocaml_version} 4.04))))

Expand Down Expand Up @@ -770,7 +764,7 @@
(subdir
man
(rule
(targets Alerts.3o.gen Alerts.Top1.3o.gen Alerts.Top2.3o.gen)
(targets Alerts.3o.gen Alerts.Top1.3o.gen)
(action
(run odoc man-generate -o . --extra-suffix gen %{dep:../alerts.odocl}))
(enabled_if
Expand All @@ -785,12 +779,6 @@
(alias runtest)
(action
(diff Alerts.Top1.3o Alerts.Top1.3o.gen))
(enabled_if
(>= %{ocaml_version} 4.04)))
(rule
(alias runtest)
(action
(diff Alerts.Top2.3o Alerts.Top2.3o.gen))
(enabled_if
(>= %{ocaml_version} 4.04))))

Expand Down
12 changes: 0 additions & 12 deletions test/generators/man/Alerts.3o
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ Alerts
.nf
.sp
\f[CB]module\fR Top1 : \f[CB]sig\fR \.\.\. \f[CB]end\fR
.fi
.br
.ti +2
Top-comment\.
.nf
.sp
\f[CB]module\fR Top2 : \f[CB]sig\fR \.\.\. \f[CB]end\fR
.fi
.br
.ti +2
Top-comment\.
.nf
.sp
\f[CB]val\fR d : int
.fi
Expand Down
4 changes: 2 additions & 2 deletions test/generators/man/Alerts.Top1.3o
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Alerts\.Top1
.in
.sp
.fi
Top-comment\.
@deprecated: A
.nf
.sp
.fi
@deprecated: A
Top-comment\.
.nf
.SH Documentation
.sp
Expand Down
21 changes: 0 additions & 21 deletions test/generators/man/Alerts.Top2.3o

This file was deleted.

1 change: 0 additions & 1 deletion test/generators/man/alerts.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Alerts.3o
Alerts.Top1.3o
Alerts.Top2.3o
Loading