569 lines
7.3 KiB
HTML
569 lines
7.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Docstrings</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Docstrings</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Docstrings - Documentation comments
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Docstrings
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Docstrings</B>
|
|
|
|
<BR> :
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
Documentation comments
|
|
<P>
|
|
Warning: this module is unstable and part of
|
|
<B>Compiler_libs</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val init </I>
|
|
|
|
:
|
|
<B>unit -> unit</B>
|
|
|
|
<P>
|
|
(Re)Initialise all docstring state
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val warn_bad_docstrings </I>
|
|
|
|
:
|
|
<B>unit -> unit</B>
|
|
|
|
<P>
|
|
Emit warnings for unattached and ambiguous docstrings
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Docstrings</H3>
|
|
|
|
<P>
|
|
<P>
|
|
|
|
<I>type docstring </I>
|
|
|
|
<P>
|
|
<P>
|
|
Documentation comments
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val docstring </I>
|
|
|
|
:
|
|
<B>string -> Location.t -> docstring</B>
|
|
|
|
<P>
|
|
Create a docstring
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val register </I>
|
|
|
|
:
|
|
<B>docstring -> unit</B>
|
|
|
|
<P>
|
|
Register a docstring
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val docstring_body </I>
|
|
|
|
:
|
|
<B>docstring -> string</B>
|
|
|
|
<P>
|
|
Get the text of a docstring
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val docstring_loc </I>
|
|
|
|
:
|
|
<B>docstring -> Location.t</B>
|
|
|
|
<P>
|
|
Get the location of a docstring
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Set functions</H3>
|
|
|
|
<P>
|
|
These functions are used by the lexer to associate docstrings to
|
|
the locations of tokens.
|
|
<P>
|
|
|
|
<P>
|
|
<I>val set_pre_docstrings </I>
|
|
|
|
:
|
|
<B>Lexing.position -> docstring list -> unit</B>
|
|
|
|
<P>
|
|
Docstrings immediately preceding a token
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set_post_docstrings </I>
|
|
|
|
:
|
|
<B>Lexing.position -> docstring list -> unit</B>
|
|
|
|
<P>
|
|
Docstrings immediately following a token
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set_floating_docstrings </I>
|
|
|
|
:
|
|
<B>Lexing.position -> docstring list -> unit</B>
|
|
|
|
<P>
|
|
Docstrings not immediately adjacent to a token
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set_pre_extra_docstrings </I>
|
|
|
|
:
|
|
<B>Lexing.position -> docstring list -> unit</B>
|
|
|
|
<P>
|
|
Docstrings immediately following the token which precedes this one
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val set_post_extra_docstrings </I>
|
|
|
|
:
|
|
<B>Lexing.position -> docstring list -> unit</B>
|
|
|
|
<P>
|
|
Docstrings immediately preceding the token which follows this one
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Items</H3>
|
|
|
|
<P>
|
|
The
|
|
<B>Docstrings.docs</B>
|
|
|
|
type represents documentation attached to an item.
|
|
<P>
|
|
|
|
<I>type docs </I>
|
|
|
|
= {
|
|
<BR> docs_pre :
|
|
<B>docstring option</B>
|
|
|
|
;
|
|
<BR> docs_post :
|
|
<B>docstring option</B>
|
|
|
|
;
|
|
<BR> }
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val empty_docs </I>
|
|
|
|
:
|
|
<B>docs</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val docs_attr </I>
|
|
|
|
:
|
|
<B>docstring -> Parsetree.attribute</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val add_docs_attrs </I>
|
|
|
|
:
|
|
<B>docs -> Parsetree.attributes -> Parsetree.attributes</B>
|
|
|
|
<P>
|
|
Convert item documentation to attributes and add them to an
|
|
attribute list
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_docs </I>
|
|
|
|
:
|
|
<B>unit -> docs</B>
|
|
|
|
<P>
|
|
Fetch the item documentation for the current symbol. This also
|
|
marks this documentation (for ambiguity warnings).
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_docs_lazy </I>
|
|
|
|
:
|
|
<B>unit -> docs Lazy.t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_docs </I>
|
|
|
|
:
|
|
<B>int -> int -> docs</B>
|
|
|
|
<P>
|
|
Fetch the item documentation for the symbols between two
|
|
positions. This also marks this documentation (for ambiguity
|
|
warnings).
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_docs_lazy </I>
|
|
|
|
:
|
|
<B>int -> int -> docs Lazy.t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val mark_symbol_docs </I>
|
|
|
|
:
|
|
<B>unit -> unit</B>
|
|
|
|
<P>
|
|
Mark the item documentation for the current symbol (for ambiguity
|
|
warnings).
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val mark_rhs_docs </I>
|
|
|
|
:
|
|
<B>int -> int -> unit</B>
|
|
|
|
<P>
|
|
Mark as associated the item documentation for the symbols between
|
|
two positions (for ambiguity warnings)
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Fields and constructors</H3>
|
|
|
|
<P>
|
|
The
|
|
<B>Docstrings.info</B>
|
|
|
|
type represents documentation attached to a field or
|
|
constructor.
|
|
<P>
|
|
|
|
<I>type info </I>
|
|
|
|
=
|
|
<B>docstring option</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val empty_info </I>
|
|
|
|
:
|
|
<B>info</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val info_attr </I>
|
|
|
|
:
|
|
<B>docstring -> Parsetree.attribute</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val add_info_attrs </I>
|
|
|
|
:
|
|
<B>info -> Parsetree.attributes -> Parsetree.attributes</B>
|
|
|
|
<P>
|
|
Convert field info to attributes and add them to an
|
|
attribute list
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_info </I>
|
|
|
|
:
|
|
<B>unit -> info</B>
|
|
|
|
<P>
|
|
Fetch the field info for the current symbol.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_info </I>
|
|
|
|
:
|
|
<B>int -> info</B>
|
|
|
|
<P>
|
|
Fetch the field info following the symbol at a given position.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Unattached comments</H3>
|
|
|
|
<P>
|
|
The
|
|
<B>Docstrings.text</B>
|
|
|
|
type represents documentation which is not attached to
|
|
anything.
|
|
<P>
|
|
|
|
<I>type text </I>
|
|
|
|
=
|
|
<B>docstring list</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val empty_text </I>
|
|
|
|
:
|
|
<B>text</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val empty_text_lazy </I>
|
|
|
|
:
|
|
<B>text Lazy.t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val text_attr </I>
|
|
|
|
:
|
|
<B>docstring -> Parsetree.attribute</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val add_text_attrs </I>
|
|
|
|
:
|
|
<B>text -> Parsetree.attributes -> Parsetree.attributes</B>
|
|
|
|
<P>
|
|
Convert text to attributes and add them to an attribute list
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_text </I>
|
|
|
|
:
|
|
<B>unit -> text</B>
|
|
|
|
<P>
|
|
Fetch the text preceding the current symbol.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_text_lazy </I>
|
|
|
|
:
|
|
<B>unit -> text Lazy.t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_text </I>
|
|
|
|
:
|
|
<B>int -> text</B>
|
|
|
|
<P>
|
|
Fetch the text preceding the symbol at the given position.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_text_lazy </I>
|
|
|
|
:
|
|
<B>int -> text Lazy.t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Extra text</H3>
|
|
|
|
<P>
|
|
There may be additional text attached to the delimiters of a block
|
|
(e.g.
|
|
<B>struct</B>
|
|
|
|
and
|
|
<B>end</B>
|
|
|
|
). This is fetched by the following
|
|
functions, which are applied to the contents of the block rather
|
|
than the delimiters.
|
|
<P>
|
|
|
|
<P>
|
|
<I>val symbol_pre_extra_text </I>
|
|
|
|
:
|
|
<B>unit -> text</B>
|
|
|
|
<P>
|
|
Fetch additional text preceding the current symbol
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val symbol_post_extra_text </I>
|
|
|
|
:
|
|
<B>unit -> text</B>
|
|
|
|
<P>
|
|
Fetch additional text following the current symbol
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_pre_extra_text </I>
|
|
|
|
:
|
|
<B>int -> text</B>
|
|
|
|
<P>
|
|
Fetch additional text preceding the symbol at the given position
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_post_extra_text </I>
|
|
|
|
:
|
|
<B>int -> text</B>
|
|
|
|
<P>
|
|
Fetch additional text following the symbol at the given position
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val rhs_post_text </I>
|
|
|
|
:
|
|
<B>int -> text</B>
|
|
|
|
<P>
|
|
Fetch text following the symbol at the given position
|
|
<P>
|
|
<P>
|
|
<I>module WithMenhir : </I>
|
|
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAE">Docstrings</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">Set functions</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">Items</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">Fields and constructors</A><DD>
|
|
<DT id="8"><A HREF="#lbAI">Unattached comments</A><DD>
|
|
<DT id="9"><A HREF="#lbAJ">Extra text</A><DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:38 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|