package ocamlformat-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=da006e427f15b9ec612fb808d446599bd9b7c3ee25abeb3d555747a70d74c6d7
sha512=b7413f8dc47ba3a2372e89d59cae54f9a602ab81e31cd14ed986a831111080b79a5a3cc45dac04d8ffae5054c35bf29fe9559f145c76c87a30e191ed5400942a
doc/ocamlformat-lib.odoc_parser/Odoc_parser/index.html
Module 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.