File: Docstrings.html

package info (click to toggle)
ocaml-doc 4.11-2
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 20,580 kB
  • sloc: sh: 37; makefile: 11
file content (307 lines) | stat: -rw-r--r-- 18,054 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="previous" href="Depend.html">
<link rel="next" href="Domainstate.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Arg_helper" rel="Chapter" href="Arg_helper.html">
<link title="Ast_helper" rel="Chapter" href="Ast_helper.html">
<link title="Ast_invariants" rel="Chapter" href="Ast_invariants.html">
<link title="Ast_iterator" rel="Chapter" href="Ast_iterator.html">
<link title="Ast_mapper" rel="Chapter" href="Ast_mapper.html">
<link title="Asttypes" rel="Chapter" href="Asttypes.html">
<link title="Attr_helper" rel="Chapter" href="Attr_helper.html">
<link title="Build_path_prefix_map" rel="Chapter" href="Build_path_prefix_map.html">
<link title="Builtin_attributes" rel="Chapter" href="Builtin_attributes.html">
<link title="CamlinternalMenhirLib" rel="Chapter" href="CamlinternalMenhirLib.html">
<link title="Ccomp" rel="Chapter" href="Ccomp.html">
<link title="Clflags" rel="Chapter" href="Clflags.html">
<link title="Compiler_libs" rel="Chapter" href="Compiler_libs.html">
<link title="Config" rel="Chapter" href="Config.html">
<link title="Consistbl" rel="Chapter" href="Consistbl.html">
<link title="Depend" rel="Chapter" href="Depend.html">
<link title="Docstrings" rel="Chapter" href="Docstrings.html">
<link title="Domainstate" rel="Chapter" href="Domainstate.html">
<link title="Identifiable" rel="Chapter" href="Identifiable.html">
<link title="Int_replace_polymorphic_compare" rel="Chapter" href="Int_replace_polymorphic_compare.html">
<link title="Lexer" rel="Chapter" href="Lexer.html">
<link title="Load_path" rel="Chapter" href="Load_path.html">
<link title="Location" rel="Chapter" href="Location.html">
<link title="Longident" rel="Chapter" href="Longident.html">
<link title="Misc" rel="Chapter" href="Misc.html">
<link title="Numbers" rel="Chapter" href="Numbers.html">
<link title="Parse" rel="Chapter" href="Parse.html">
<link title="Parser" rel="Chapter" href="Parser.html">
<link title="Parsetree" rel="Chapter" href="Parsetree.html">
<link title="Pparse" rel="Chapter" href="Pparse.html">
<link title="Pprintast" rel="Chapter" href="Pprintast.html">
<link title="Printast" rel="Chapter" href="Printast.html">
<link title="Profile" rel="Chapter" href="Profile.html">
<link title="Strongly_connected_components" rel="Chapter" href="Strongly_connected_components.html">
<link title="Syntaxerr" rel="Chapter" href="Syntaxerr.html">
<link title="Targetint" rel="Chapter" href="Targetint.html">
<link title="Terminfo" rel="Chapter" href="Terminfo.html">
<link title="Warnings" rel="Chapter" href="Warnings.html"><link title="Docstrings" rel="Section" href="#2_Docstrings">
<link title="Set functions" rel="Section" href="#2_Setfunctions">
<link title="Items" rel="Section" href="#2_Items">
<link title="Fields and constructors" rel="Section" href="#2_Fieldsandconstructors">
<link title="Unattached comments" rel="Section" href="#2_Unattachedcomments">
<link title="Extra text" rel="Section" href="#2_Extratext">
<title>Docstrings</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Depend.html" title="Depend">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Domainstate.html" title="Domainstate">Next</a>
</div>
<h1>Module <a href="type_Docstrings.html">Docstrings</a></h1>

<pre><span id="MODULEDocstrings"><span class="keyword">module</span> Docstrings</span>: <code class="code"><span class="keyword">sig</span></code> <a href="Docstrings.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top">
<div class="info-desc">
<p>Documentation comments</p>

<p><b>Warning:</b> this module is unstable and part of
  <a href="Compiler_libs.html">compiler-libs</a>.</p>
</div>
</div>
<hr width="100%">

<pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">unit -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>(Re)Initialise all docstring state</p>
</div>
</div>

<pre><span id="VALwarn_bad_docstrings"><span class="keyword">val</span> warn_bad_docstrings</span> : <code class="type">unit -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Emit warnings for unattached and ambiguous docstrings</p>
</div>
</div>
<h3 id="2_Docstrings">Docstrings</h3>
<pre><span id="TYPEdocstring"><span class="keyword">type</span> <code class="type"></code>docstring</span> </pre>
<div class="info ">
<div class="info-desc">
<p>Documentation comments</p>
</div>
</div>


<pre><span id="VALdocstring"><span class="keyword">val</span> docstring</span> : <code class="type">string -> <a href="Location.html#TYPEt">Location.t</a> -> <a href="Docstrings.html#TYPEdocstring">docstring</a></code></pre><div class="info ">
<div class="info-desc">
<p>Create a docstring</p>
</div>
</div>

<pre><span id="VALregister"><span class="keyword">val</span> register</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Register a docstring</p>
</div>
</div>

<pre><span id="VALdocstring_body"><span class="keyword">val</span> docstring_body</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> string</code></pre><div class="info ">
<div class="info-desc">
<p>Get the text of a docstring</p>
</div>
</div>

<pre><span id="VALdocstring_loc"><span class="keyword">val</span> docstring_loc</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> <a href="Location.html#TYPEt">Location.t</a></code></pre><div class="info ">
<div class="info-desc">
<p>Get the location of a docstring</p>
</div>
</div>
<h3 id="2_Setfunctions">Set functions</h3>
<p>These functions are used by the lexer to associate docstrings to
   the locations of tokens.</p>

<pre><span id="VALset_pre_docstrings"><span class="keyword">val</span> set_pre_docstrings</span> : <code class="type">Lexing.position -> <a href="Docstrings.html#TYPEdocstring">docstring</a> list -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Docstrings immediately preceding a token</p>
</div>
</div>

<pre><span id="VALset_post_docstrings"><span class="keyword">val</span> set_post_docstrings</span> : <code class="type">Lexing.position -> <a href="Docstrings.html#TYPEdocstring">docstring</a> list -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Docstrings immediately following a token</p>
</div>
</div>

<pre><span id="VALset_floating_docstrings"><span class="keyword">val</span> set_floating_docstrings</span> : <code class="type">Lexing.position -> <a href="Docstrings.html#TYPEdocstring">docstring</a> list -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Docstrings not immediately adjacent to a token</p>
</div>
</div>

<pre><span id="VALset_pre_extra_docstrings"><span class="keyword">val</span> set_pre_extra_docstrings</span> : <code class="type">Lexing.position -> <a href="Docstrings.html#TYPEdocstring">docstring</a> list -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Docstrings immediately following the token which precedes this one</p>
</div>
</div>

<pre><span id="VALset_post_extra_docstrings"><span class="keyword">val</span> set_post_extra_docstrings</span> : <code class="type">Lexing.position -> <a href="Docstrings.html#TYPEdocstring">docstring</a> list -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Docstrings immediately preceding the token which follows this one</p>
</div>
</div>
<h3 id="2_Items">Items</h3>
<p>The <a href="Docstrings.html#TYPEdocs"><code class="code"><span class="constructor">Docstrings</span>.docs</code></a> type represents documentation attached to an item.</p>

<pre><code><span id="TYPEdocs"><span class="keyword">type</span> <code class="type"></code>docs</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTdocs.docs_pre">docs_pre</span>&nbsp;: <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> option</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTdocs.docs_post">docs_post</span>&nbsp;: <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> option</code>;</code></td>

</tr></table>
<code>}</code>



<pre><span id="VALempty_docs"><span class="keyword">val</span> empty_docs</span> : <code class="type"><a href="Docstrings.html#TYPEdocs">docs</a></code></pre>
<pre><span id="VALdocs_attr"><span class="keyword">val</span> docs_attr</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> <a href="Parsetree.html#TYPEattribute">Parsetree.attribute</a></code></pre>
<pre><span id="VALadd_docs_attrs"><span class="keyword">val</span> add_docs_attrs</span> : <code class="type"><a href="Docstrings.html#TYPEdocs">docs</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a></code></pre><div class="info ">
<div class="info-desc">
<p>Convert item documentation to attributes and add them to an
    attribute list</p>
</div>
</div>

<pre><span id="VALsymbol_docs"><span class="keyword">val</span> symbol_docs</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEdocs">docs</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the item documentation for the current symbol. This also
    marks this documentation (for ambiguity warnings).</p>
</div>
</div>

<pre><span id="VALsymbol_docs_lazy"><span class="keyword">val</span> symbol_docs_lazy</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEdocs">docs</a> Lazy.t</code></pre>
<pre><span id="VALrhs_docs"><span class="keyword">val</span> rhs_docs</span> : <code class="type">int -> int -> <a href="Docstrings.html#TYPEdocs">docs</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the item documentation for the symbols between two
    positions. This also marks this documentation (for ambiguity
    warnings).</p>
</div>
</div>

<pre><span id="VALrhs_docs_lazy"><span class="keyword">val</span> rhs_docs_lazy</span> : <code class="type">int -> int -> <a href="Docstrings.html#TYPEdocs">docs</a> Lazy.t</code></pre>
<pre><span id="VALmark_symbol_docs"><span class="keyword">val</span> mark_symbol_docs</span> : <code class="type">unit -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Mark the item documentation for the current symbol (for ambiguity
    warnings).</p>
</div>
</div>

<pre><span id="VALmark_rhs_docs"><span class="keyword">val</span> mark_rhs_docs</span> : <code class="type">int -> int -> unit</code></pre><div class="info ">
<div class="info-desc">
<p>Mark as associated the item documentation for the symbols between
    two positions (for ambiguity warnings)</p>
</div>
</div>
<h3 id="2_Fieldsandconstructors">Fields and constructors</h3>
<p>The <a href="Docstrings.html#TYPEinfo"><code class="code"><span class="constructor">Docstrings</span>.info</code></a> type represents documentation attached to a field or
    constructor.</p>

<pre><span id="TYPEinfo"><span class="keyword">type</span> <code class="type"></code>info</span> = <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> option</code> </pre>


<pre><span id="VALempty_info"><span class="keyword">val</span> empty_info</span> : <code class="type"><a href="Docstrings.html#TYPEinfo">info</a></code></pre>
<pre><span id="VALinfo_attr"><span class="keyword">val</span> info_attr</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> <a href="Parsetree.html#TYPEattribute">Parsetree.attribute</a></code></pre>
<pre><span id="VALadd_info_attrs"><span class="keyword">val</span> add_info_attrs</span> : <code class="type"><a href="Docstrings.html#TYPEinfo">info</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a></code></pre><div class="info ">
<div class="info-desc">
<p>Convert field info to attributes and add them to an
    attribute list</p>
</div>
</div>

<pre><span id="VALsymbol_info"><span class="keyword">val</span> symbol_info</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEinfo">info</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the field info for the current symbol.</p>
</div>
</div>

<pre><span id="VALrhs_info"><span class="keyword">val</span> rhs_info</span> : <code class="type">int -> <a href="Docstrings.html#TYPEinfo">info</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the field info following the symbol at a given position.</p>
</div>
</div>
<h3 id="2_Unattachedcomments">Unattached comments</h3>
<p>The <a href="Docstrings.html#TYPEtext"><code class="code"><span class="constructor">Docstrings</span>.text</code></a> type represents documentation which is not attached to
    anything.</p>

<pre><span id="TYPEtext"><span class="keyword">type</span> <code class="type"></code>text</span> = <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> list</code> </pre>


<pre><span id="VALempty_text"><span class="keyword">val</span> empty_text</span> : <code class="type"><a href="Docstrings.html#TYPEtext">text</a></code></pre>
<pre><span id="VALempty_text_lazy"><span class="keyword">val</span> empty_text_lazy</span> : <code class="type"><a href="Docstrings.html#TYPEtext">text</a> Lazy.t</code></pre>
<pre><span id="VALtext_attr"><span class="keyword">val</span> text_attr</span> : <code class="type"><a href="Docstrings.html#TYPEdocstring">docstring</a> -> <a href="Parsetree.html#TYPEattribute">Parsetree.attribute</a></code></pre>
<pre><span id="VALadd_text_attrs"><span class="keyword">val</span> add_text_attrs</span> : <code class="type"><a href="Docstrings.html#TYPEtext">text</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a> -> <a href="Parsetree.html#TYPEattributes">Parsetree.attributes</a></code></pre><div class="info ">
<div class="info-desc">
<p>Convert text to attributes and add them to an attribute list</p>
</div>
</div>

<pre><span id="VALsymbol_text"><span class="keyword">val</span> symbol_text</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the text preceding the current symbol.</p>
</div>
</div>

<pre><span id="VALsymbol_text_lazy"><span class="keyword">val</span> symbol_text_lazy</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEtext">text</a> Lazy.t</code></pre>
<pre><span id="VALrhs_text"><span class="keyword">val</span> rhs_text</span> : <code class="type">int -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch the text preceding the symbol at the given position.</p>
</div>
</div>

<pre><span id="VALrhs_text_lazy"><span class="keyword">val</span> rhs_text_lazy</span> : <code class="type">int -> <a href="Docstrings.html#TYPEtext">text</a> Lazy.t</code></pre><h3 id="2_Extratext">Extra text</h3>
<p>There may be additional text attached to the delimiters of a block
    (e.g. <code class="code"><span class="keyword">struct</span></code> and <code class="code"><span class="keyword">end</span></code>). This is fetched by the following
    functions, which are applied to the contents of the block rather
    than the delimiters.</p>

<pre><span id="VALsymbol_pre_extra_text"><span class="keyword">val</span> symbol_pre_extra_text</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch additional text preceding the current symbol</p>
</div>
</div>

<pre><span id="VALsymbol_post_extra_text"><span class="keyword">val</span> symbol_post_extra_text</span> : <code class="type">unit -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch additional text following the current symbol</p>
</div>
</div>

<pre><span id="VALrhs_pre_extra_text"><span class="keyword">val</span> rhs_pre_extra_text</span> : <code class="type">int -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch additional text preceding the symbol at the given position</p>
</div>
</div>

<pre><span id="VALrhs_post_extra_text"><span class="keyword">val</span> rhs_post_extra_text</span> : <code class="type">int -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch additional text following the symbol at the given position</p>
</div>
</div>

<pre><span id="VALrhs_post_text"><span class="keyword">val</span> rhs_post_text</span> : <code class="type">int -> <a href="Docstrings.html#TYPEtext">text</a></code></pre><div class="info ">
<div class="info-desc">
<p>Fetch text following the symbol at the given position</p>
</div>
</div>

<pre><span id="MODULEWithMenhir"><span class="keyword">module</span> <a href="Docstrings.WithMenhir.html">WithMenhir</a></span>: <code class="code"><span class="keyword">sig</span></code> <a href="Docstrings.WithMenhir.html">..</a> <code class="code"><span class="keyword">end</span></code></pre></body></html>