package atdgen

  1. Overview
  2. Docs
Generates efficient JSON serializers, deserializers and validators

Install

Dune Dependency

Authors

Maintainers

Sources

v1.12.0.tar.gz
sha256=3e81d562e74374b98c0f383c1ded46beb06d8416d2065645fd68d3b8b0238ddd
md5=f85f590714edcdd4b847aa242b6c5747

doc/src/atdgen/ag_doc.ml.html

Source file ag_doc.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

type inline =
    [ `Text of string
    | `Code of string ]
type block = [ `Paragraph of inline list | `Pre of string ]
type doc = [ `Text of block list ]

let parse_text loc s =
  try Some (Some (`Text (Ag_doc_lexer.parse_string s : block list)))
  with e ->
    failwith (Printf.sprintf "%s:\nInvalid format for doc.text %S:\n%s"
                (Atd_ast.string_of_loc loc) s (Printexc.to_string e))

let get_doc loc an : doc option =
  Atd_annot.get_field (parse_text loc) None ["doc"] "text" an
OCaml

Innovation. Community. Security.