package ocamlformat-mlx-lib

  1. Overview
  2. Docs
OCaml .mlx Code Formatter

Install

Dune Dependency

Authors

Maintainers

Sources

ocamlformat-mlx-0.27.0.1.tbz
sha256=4557bcca3d2bd2b6d37b046a84a82a1bed83e46e45e363c0b209d30d70c0ec77
sha512=2802651c733bf3535ce9d2e4e533729da75b17e9507d911f4d79d1a68f35ddfb82db1daf8815a46d57a9937dea5b5466d523739c217ace0e446738208037ec2d

doc/ocamlformat-mlx-lib.odoc_parser/Ocamlformat_odoc_parser/Odoc_parser/index.html

Module Ocamlformat_odoc_parser.Odoc_parserSource

Parser for ocamldoc formatted comments.

Sourcetype t

type t is the result of parsing.

Sourceval parse_comment : location:Lexing.position -> text:string -> t

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 })

Sourcemodule Ast = Ast
Sourcemodule Loc = Loc
Sourcemodule Warning : sig ... end

Warnings produced during parsing.

Sourceval warnings : t -> Warning.t list

Extract any warnings from the parser result.

Sourceval ast : t -> Ast.t

Extract the Ast.t from the parser result.

Sourceval position_of_point : t -> Loc.point -> Lexing.position

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.

OCaml

Innovation. Community. Security.