1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Jeremie Dimino, Jane Street Europe *)
6 (* *)
7 (* Copyright 2015 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (** Helpers for attributes
17
18 {b Warning:} this module is unstable and part of
19 {{!Compiler_libs}compiler-libs}.
20
21 *)
22
23 open Asttypes
24 open Parsetree
25
26 type error =
27 | Multiple_attributes of string
28 | No_payload_expected of string
29
30 (** The [string list] argument of the following functions is a list of
31 alternative names for the attribute we are looking for. For instance:
32
33 {[
34 ["foo"; "ocaml.foo"]
35 ]} *)
36 val get_no_payload_attribute : string list -> attributes -> string loc option
37 val has_no_payload_attribute : string list -> attributes -> bool
38
39 exception Error of Location.t * error
40
41 val report_error: Format.formatter -> error -> unit
42