Module Docstrings
: sigend
Documentation comments
Warning: this module is unstable and part of Compiler_libs .
valinit : unit->unit
(Re)Initialise all docstring state
valwarn_bad_docstrings : unit->unit
Emit warnings for unattached and ambiguous docstrings
Docstringstypedocstring
Documentation comments
valdocstring : string->Location.t->docstring
Create a docstring
valregister : docstring->unit
Register a docstring
valdocstring_body : docstring->string
Get the text of a docstring
valdocstring_loc : docstring->Location.t
Get the location of a docstring
Setfunctions
These functions are used by the lexer to associate docstrings to the locations of tokens.
valset_pre_docstrings : Lexing.position->docstringlist->unit
Docstrings immediately preceding a token
valset_post_docstrings : Lexing.position->docstringlist->unit
Docstrings immediately following a token
valset_floating_docstrings : Lexing.position->docstringlist->unit
Docstrings not immediately adjacent to a token
valset_pre_extra_docstrings : Lexing.position->docstringlist->unit
Docstrings immediately following the token which precedes this one
valset_post_extra_docstrings : Lexing.position->docstringlist->unit
Docstrings immediately preceding the token which follows this one
Items
The Docstrings.docs type represents documentation attached to an item.
typedocs = {
docs_pre : docstringoption ;
docs_post : docstringoption ;
}
valempty_docs : docsvaldocs_attr : docstring->Parsetree.attributevaladd_docs_attrs : docs->Parsetree.attributes->Parsetree.attributes
Convert item documentation to attributes and add them to an attribute list
valsymbol_docs : unit->docs
Fetch the item documentation for the current symbol. This also marks this documentation (for ambiguity
warnings).
valsymbol_docs_lazy : unit->docsLazy.tvalrhs_docs : int->int->docs
Fetch the item documentation for the symbols between two positions. This also marks this documentation
(for ambiguity warnings).
valrhs_docs_lazy : int->int->docsLazy.tvalmark_symbol_docs : unit->unit
Mark the item documentation for the current symbol (for ambiguity warnings).
valmark_rhs_docs : int->int->unit
Mark as associated the item documentation for the symbols between two positions (for ambiguity warnings)
Fieldsandconstructors
The Docstrings.info type represents documentation attached to a field or constructor.
typeinfo = docstringoptionvalempty_info : infovalinfo_attr : docstring->Parsetree.attributevaladd_info_attrs : info->Parsetree.attributes->Parsetree.attributes
Convert field info to attributes and add them to an attribute list
valsymbol_info : unit->info
Fetch the field info for the current symbol.
valrhs_info : int->info
Fetch the field info following the symbol at a given position.
Unattachedcomments
The Docstrings.text type represents documentation which is not attached to anything.
typetext = docstringlistvalempty_text : textvalempty_text_lazy : textLazy.tvaltext_attr : docstring->Parsetree.attributevaladd_text_attrs : text->Parsetree.attributes->Parsetree.attributes
Convert text to attributes and add them to an attribute list
valsymbol_text : unit->text
Fetch the text preceding the current symbol.
valsymbol_text_lazy : unit->textLazy.tvalrhs_text : int->text
Fetch the text preceding the symbol at the given position.
valrhs_text_lazy : int->textLazy.tExtratext
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.
valsymbol_pre_extra_text : unit->text
Fetch additional text preceding the current symbol
valsymbol_post_extra_text : unit->text
Fetch additional text following the current symbol
valrhs_pre_extra_text : int->text
Fetch additional text preceding the symbol at the given position
valrhs_post_extra_text : int->text
Fetch additional text following the symbol at the given position
valrhs_post_text : int->text
Fetch text following the symbol at the given position
moduleWithMenhir:sigend
OCamldoc 2025-06-12 Docstrings(3o)