Commit 5479b959 authored by POTTIER Francois's avatar POTTIER Francois

Adapt to the change of the type [attribute] in 4.08.

parent 1b93fe4d
......@@ -151,3 +151,21 @@ let row_field_to_core_types (field : row_field) : core_type list =
| Rinherit ty ->
[ ty ]
#endif
(* -------------------------------------------------------------------------- *)
(* [floating s items] produces a floating attribute whose name is [s] and
whose payload is the list of structure items [items]. *)
(* The type [attribute] is defined in 4.07 as [string loc * payload], but in
4.08 its definition changes to a record type and the function [Attr.mk]
appears. *)
let floating (s : string) (items : structure) : structure_item =
let name = mknoloc s
and payload = PStr items in
#if OCAML_VERSION < (4, 08, 0)
Str.attribute (name, payload)
#else
Str.attribute (Attr.mk name payload)
#endif
......@@ -342,14 +342,6 @@ let include_ (e : module_expr) : structure_item =
(* -------------------------------------------------------------------------- *)
(* [floating s items] produces a floating attribute whose name is [s] and
whose payload is the list of structure items [items]. *)
let floating (s : string) (items : structure) : structure_item =
Str.attribute (mknoloc s, PStr items)
(* -------------------------------------------------------------------------- *)
(* [with_warnings w items] wraps the structure items [items] in such a way
that the warning directive [w] is applied to these items. Technically, this
is done by emitting [include struct [@@@ocaml.warning <w>] <items> end]. *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment