package ppx_deriving_yaml

  1. Overview
  2. Docs

Source file attrs.ml

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
open Ppxlib

let key =
  Attribute.declare "yaml.key" Attribute.Context.label_declaration
    Ast_pattern.(pstr (pstr_eval (estring __) nil ^:: nil))
    (fun x -> x)

let name =
  Attribute.declare "yaml.name" Attribute.Context.constructor_declaration
    Ast_pattern.(pstr (pstr_eval (estring __) nil ^:: nil))
    (fun x -> x)

let default =
  Attribute.declare "yaml.default" Attribute.Context.label_declaration
    Ast_pattern.(single_expr_payload __)
    (fun x -> x)

let to_yaml =
  Attribute.declare "yaml.to_yaml" Attribute.Context.label_declaration
    Ast_pattern.(single_expr_payload __)
    (fun x -> x)

let of_yaml =
  Attribute.declare "yaml.of_yaml" Attribute.Context.label_declaration
    Ast_pattern.(single_expr_payload __)
    (fun x -> x)