@@ -188,17 +188,16 @@ type surrounding =
188
188
* Odoc_parser.Ast .inline_element Location_ .with_location list ]
189
189
190
190
let rec non_link_inline_element :
191
- status ->
192
191
surrounding :surrounding ->
193
192
Odoc_parser.Ast. inline_element with_location ->
194
193
Comment. non_link_inline_element with_location =
195
- fun status ~surrounding element ->
194
+ fun ~surrounding element ->
196
195
match element with
197
196
| { value = #ast_leaf_inline_element ; _ } as element ->
198
197
(leaf_inline_element element
199
198
:> Comment. non_link_inline_element with_location)
200
199
| { value = `Styled (style , content ); _ } ->
201
- `Styled (style, non_link_inline_elements status ~surrounding content)
200
+ `Styled (style, non_link_inline_elements ~surrounding content)
202
201
|> Location. same element
203
202
| ( { value = `Reference (_, _, content); _ }
204
203
| { value = `Link (_ , content ); _ } ) as element ->
@@ -208,29 +207,26 @@ let rec non_link_inline_element :
208
207
element.location
209
208
|> Error. raise_warning;
210
209
211
- `Styled (`Emphasis , non_link_inline_elements status ~surrounding content)
210
+ `Styled (`Emphasis , non_link_inline_elements ~surrounding content)
212
211
|> Location. same element
213
212
214
- and non_link_inline_elements status ~surrounding elements =
215
- List. map (non_link_inline_element status ~surrounding ) elements
213
+ and non_link_inline_elements ~surrounding elements =
214
+ List. map (non_link_inline_element ~surrounding ) elements
216
215
217
216
let rec inline_element :
218
- status ->
219
217
Odoc_parser.Ast. inline_element with_location ->
220
218
Comment. inline_element with_location =
221
- fun status element ->
219
+ fun element ->
222
220
match element with
223
221
| { value = #ast_leaf_inline_element ; _ } as element ->
224
222
(leaf_inline_element element :> Comment.inline_element with_location )
225
223
| { value = `Styled (style , content ); location } ->
226
- `Styled (style, inline_elements status content) |> Location. at location
224
+ `Styled (style, inline_elements content) |> Location. at location
227
225
| { value = `Reference (kind , target , content ) as value ; location } -> (
228
226
let { Location. value = target; location = target_location } = target in
229
227
match Error. raise_warnings (Reference. parse target_location target) with
230
228
| Result. Ok target ->
231
- let content =
232
- non_link_inline_elements status ~surrounding: value content
233
- in
229
+ let content = non_link_inline_elements ~surrounding: value content in
234
230
Location. at location (`Reference (target, content))
235
231
| Result. Error error ->
236
232
Error. raise_warning error;
@@ -239,21 +235,20 @@ let rec inline_element :
239
235
| `Simple -> `Code_span target
240
236
| `With_text -> `Styled (`Emphasis , content)
241
237
in
242
- inline_element status (Location. at location placeholder))
238
+ inline_element (Location. at location placeholder))
243
239
| { value = `Link (target , content ) as value ; location } ->
244
- `Link (target, non_link_inline_elements status ~surrounding: value content)
240
+ `Link (target, non_link_inline_elements ~surrounding: value content)
245
241
|> Location. at location
246
242
247
- and inline_elements status elements = List. map ( inline_element status) elements
243
+ and inline_elements elements = List. map inline_element elements
248
244
249
245
let rec nestable_block_element :
250
- status ->
251
246
Odoc_parser.Ast. nestable_block_element with_location ->
252
247
Comment. nestable_block_element with_location =
253
- fun status element ->
248
+ fun element ->
254
249
match element with
255
250
| { value = `Paragraph content ; location } ->
256
- Location. at location (`Paragraph (inline_elements status content))
251
+ Location. at location (`Paragraph (inline_elements content))
257
252
| { value = `Code_block { meta; delimiter = _; content; output }; location }
258
253
->
259
254
let lang_tag =
@@ -264,7 +259,7 @@ let rec nestable_block_element :
264
259
let outputs =
265
260
match output with
266
261
| None -> None
267
- | Some l -> Some (List. map ( nestable_block_element status) l)
262
+ | Some l -> Some (List. map nestable_block_element l)
268
263
in
269
264
Location. at location (`Code_block (lang_tag, content, outputs))
270
265
| { value = `Math_block s ; location } -> Location. at location (`Math_block s)
@@ -286,13 +281,13 @@ let rec nestable_block_element :
286
281
in
287
282
Location. at location (`Modules modules)
288
283
| { value = `List (kind , _syntax , items ); location } ->
289
- `List (kind, List. map ( nestable_block_elements status) items)
284
+ `List (kind, List. map nestable_block_elements items)
290
285
|> Location. at location
291
286
| { value = `Table ((grid , align ), (`Heavy | `Light )); location } ->
292
287
let data =
293
288
List. map
294
289
(List. map (fun (cell , cell_type ) ->
295
- (nestable_block_elements status cell, cell_type)))
290
+ (nestable_block_elements cell, cell_type)))
296
291
grid
297
292
in
298
293
`Table { Comment. data; align } |> Location. at location
@@ -312,17 +307,15 @@ let rec nestable_block_element :
312
307
| `With_text ->
313
308
`Styled (`Emphasis , [ `Word content |> Location. at location ])
314
309
in
315
- `Paragraph
316
- (inline_elements status [ placeholder |> Location. at location ])
310
+ `Paragraph (inline_elements [ placeholder |> Location. at location ])
317
311
|> Location. at location
318
312
in
319
313
match Error. raise_warnings (Reference. parse_asset href_location href) with
320
314
| Result. Ok target ->
321
315
`Media (`Reference target, m, content) |> Location. at location
322
316
| Result. Error error -> fallback error)
323
317
324
- and nestable_block_elements status elements =
325
- List. map (nestable_block_element status) elements
318
+ and nestable_block_elements elements = List. map nestable_block_element elements
326
319
327
320
let tag :
328
321
location :Location. span ->
@@ -339,26 +332,23 @@ let tag :
339
332
let ok t = Result. Ok (Location. at location (`Tag t)) in
340
333
match tag with
341
334
| (`Author _ | `Since _ | `Version _ ) as tag -> ok tag
342
- | `Deprecated content ->
343
- ok (`Deprecated (nestable_block_elements status content))
335
+ | `Deprecated content -> ok (`Deprecated (nestable_block_elements content))
344
336
| `Param (name , content ) ->
345
- ok (`Param (name, nestable_block_elements status content))
337
+ ok (`Param (name, nestable_block_elements content))
346
338
| `Raise (name , content ) -> (
347
339
match Error. raise_warnings (Reference. parse location name) with
348
340
(* TODO: location for just name * )
349
341
| Result. Ok target ->
350
- ok
351
- (`Raise
352
- (`Reference (target, [] ), nestable_block_elements status content))
342
+ ok (`Raise (`Reference (target, [] ), nestable_block_elements content))
353
343
| Result. Error error ->
354
344
Error. raise_warning error;
355
345
let placeholder = `Code_span name in
356
- ok (`Raise (placeholder, nestable_block_elements status content)))
357
- | `Return content -> ok (`Return (nestable_block_elements status content))
346
+ ok (`Raise (placeholder, nestable_block_elements content)))
347
+ | `Return content -> ok (`Return (nestable_block_elements content))
358
348
| `See (kind , target , content ) ->
359
- ok (`See (kind, target, nestable_block_elements status content))
349
+ ok (`See (kind, target, nestable_block_elements content))
360
350
| `Before (version , content ) ->
361
- ok (`Before (version, nestable_block_elements status content))
351
+ ok (`Before (version, nestable_block_elements content))
362
352
363
353
(* When the user does not give a section heading a label (anchor), we generate
364
354
one from the text in the heading. This is the common case. This involves
@@ -423,7 +413,7 @@ let section_heading :
423
413
fun status ~top_heading_level location heading ->
424
414
let (`Heading (level, label, content)) = heading in
425
415
426
- let text = inline_elements status content in
416
+ let text = inline_elements content in
427
417
428
418
let heading_label_explicit, label =
429
419
match label with
@@ -491,7 +481,7 @@ let top_level_block_elements status ast_elements =
491
481
492
482
match ast_element with
493
483
| { value = #Odoc_parser.Ast. nestable_block_element ; _ } as element ->
494
- let element = nestable_block_element status element in
484
+ let element = nestable_block_element element in
495
485
let element = (element :> Comment.block_element with_location ) in
496
486
traverse ~top_heading_level
497
487
(element :: comment_elements_acc)
0 commit comments