module Docstrings: sig .. end
let init: unit => unit;
let warn_bad_docstrings: unit => unit;
type docstring;
let docstring: (string, Location.t) => docstring;
let docstring_body: docstring => string;
let docstring_loc: docstring => Location.t;
These functions are used by the lexer to associate docstrings to
the locations of tokens.
let set_pre_docstrings: (Lexing.position, list(docstring)) => unit;
let set_post_docstrings: (Lexing.position, list(docstring)) => unit;
let set_floating_docstrings: (Lexing.position, list(docstring)) => unit;
let set_pre_extra_docstrings: (Lexing.position, list(docstring)) => unit;
let set_post_extra_docstrings: (Lexing.position, list(docstring)) => unit;
The Docstrings.docs
type represents documentation attached to an item.
type docs = {
|
docs_pre : docstring option; |
|
docs_post : docstring option; |
let empty_docs: docs;
let docs_attr: docstring => Parsetree.attribute;
let add_docs_attrs: (docs, Parsetree.attributes) => Parsetree.attributes;
let symbol_docs: unit => docs;
let symbol_docs_lazy: unit => Lazy.t(docs);
let rhs_docs: (int, int) => docs;
let rhs_docs_lazy: (int, int) => Lazy.t(docs);
let mark_symbol_docs: unit => unit;
let mark_rhs_docs: (int, int) => unit;
The Docstrings.info
type represents documentation attached to a field or
constructor.
type info = option(docstring);
let empty_info: info;
let info_attr: docstring => Parsetree.attribute;
let add_info_attrs: (info, Parsetree.attributes) => Parsetree.attributes;
let symbol_info: unit => info;
let rhs_info: int => info;
The Docstrings.text
type represents documentation which is not attached to
anything.
type text = list(docstring);
let empty_text: text;
let text_attr: docstring => Parsetree.attribute;
let add_text_attrs: (text, Parsetree.attributes) => Parsetree.attributes;
let symbol_text: unit => text;
let symbol_text_lazy: unit => Lazy.t(text);
let rhs_text: int => text;
let rhs_text_lazy: int => Lazy.t(text);
There may be additional text attached to the delimiters of a block
(e.g. struct
and end
). This is fetched by the following
functions, which are applied to the contents of the block rather
than the delimiters.
let symbol_pre_extra_text: unit => text;
let symbol_post_extra_text: unit => text;
let rhs_pre_extra_text: int => text;
let rhs_post_extra_text: int => text;