package ocamlformat-mlx-lib

  1. Overview
  2. Docs
OCaml .mlx Code Formatter

Install

Dune Dependency

Authors

Maintainers

Sources

0.26.2.0.tar.gz
md5=4b32d3b57da54157a0cd8f772094f4bc
sha512=367eeb5d81060a3efb584796cc72cc75d974975bb9b18be6284a86f5937edb90927368fd80e00b3f4c1894e609b4a1503c20d4495c624560243e5055f905390a

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

Module Odoc_parser.AstSource

Abstract syntax tree representing ocamldoc comments

This is a syntactic representation of ocamldoc comments. See The manual for a detailed description of the syntax understood. Note that there is no attempt at semantic analysis, and hence these types are capable of representing values that will be rejected by further stages, for example, invalid references or headings that are out of range.

Sourcetype 'a with_location = 'a Loc.with_location
Sourcetype style = [
  1. | `Bold
  2. | `Italic
  3. | `Emphasis
  4. | `Superscript
  5. | `Subscript
]
Sourcetype reference_kind = [
  1. | `Simple
  2. | `With_text
]

References in doc comments can be of two kinds: {!simple} or {{!ref}With text}.

Sourcetype inline_element = [
  1. | `Space of string
  2. | `Word of string
  3. | `Code_span of string
  4. | `Raw_markup of string option * string
  5. | `Styled of style * inline_element with_location list
  6. | `Reference of reference_kind * string with_location * inline_element with_location list
  7. | `Math_span of string
    (*
    • since 2.0.0
    *)
]

Inline elements are equivalent to what would be found in a span in HTML. Mostly these are straightforward. The `Reference constructor takes a triple whose second element is the reference itself, and the third the replacement text. Similarly the `Link constructor has the link itself as first parameter and the second is the replacement text.

Sourcetype nestable_block_element = [
  1. | `Paragraph of inline_element with_location list
  2. | `Code_block of (string with_location * string with_location option) option * string with_location
  3. | `Verbatim of string
  4. | `Modules of string with_location list
  5. | `List of [ `Unordered | `Ordered ] * [ `Light | `Heavy ] * nestable_block_element with_location list list
  6. | `Math_block of string
    (*
    • since 2.0.0
    *)
]

Some block elements may be nested within lists or tags, but not all. The `List constructor has a parameter of type [`Light | `Heavy]. This corresponds to the syntactic constructor used (see the manual).

Sourcetype internal_tag = [
  1. | `Canonical of string with_location
  2. | `Inline
  3. | `Open
  4. | `Closed
]

Internal tags are used to exercise fine control over the output of odoc. They are never rendered in the output

Sourcetype ocamldoc_tag = [
  1. | `Author of string
  2. | `Deprecated of nestable_block_element with_location list
  3. | `Param of string * nestable_block_element with_location list
  4. | `Raise of string * nestable_block_element with_location list
  5. | `Return of nestable_block_element with_location list
  6. | `See of [ `Url | `File | `Document ] * string * nestable_block_element with_location list
  7. | `Since of string
  8. | `Before of string * nestable_block_element with_location list
  9. | `Version of string
]

ocamldoc tags are those that are specified in the manual)

Sourcetype heading = int * string option * inline_element with_location list
Sourcetype block_element = [
  1. | nestable_block_element
  2. | `Heading of heading
  3. | `Tag of tag
]
OCaml

Innovation. Community. Security.