package ocamlformat-mlx-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=af4e7ed7e84bd681e1058c3573e255427aa3c3a9952c115f1c2441295766d14c
sha512=48a153ad33283a95b3d5a54cd04e8a26feb5d394b291a45aa01f77e376bcfc94a2b6350b3f3611a3d2511f25b0f69f6d2d694d7ace81004ed7e6850ac6947b4c
doc/ocamlformat-mlx-lib.odoc_parser/Ocamlformat_odoc_parser/Odoc_parser/index.html
Module Ocamlformat_odoc_parser.Odoc_parserSource
Parser for ocamldoc formatted comments.
type t is the result of parsing.
parse_comment ~location ~text parses text as an ocamldoc formatted string. The parser will try to recover from any invalid syntax encountered, and therefore this will always produce a result without raising exceptions with zero or more warnings. The location passed in should represent the start of the content of the documentation comment - so for a line such as
(** A comment starting in the first column (0) *)the location should represent the space immediately before the A, so the in the 4th column (e.g. {... pos_bol=0; pos_cnum=3 })
Helper function to turn the internal representation of positions back into the usual representation in the Lexing module. Note that this relies on the information passed in parse_comment, and hence requires the result of that call in addition to the Loc.point being converted.
Process the content of a code block, following the rules described here. To achieve this, it needs the location of the code block (including the separators) and the raw content of the code block. For instance, with the following code block:
{[
hello
]}We can go from the raw content "\n hello\n " to the processed content " hello" with:
match codeblock.value with
| `Code_block { content; _ } ->
codeblock_content codeblock.location content.valueAlso returns a list of warnings, eg if the content is not appropriately indented.
Similar to codeblock_content but for verbatims.