diff --git a/src/meta.ml b/src/meta.ml index cf8d9332..4f5ac2cd 100644 --- a/src/meta.ml +++ b/src/meta.ml @@ -13,9 +13,8 @@ and entry = and action = Set | Add and predicate = - | P of string (* Present *) - | A of string (* Absent *) - + | P of string + | A of string module Parse = struct let error = lex_error @@ -91,6 +90,6 @@ module Parse = struct error lb "'package' or variable name expected" end -let parse fn = +let load fn = with_lexbuf_from_file fn ~f:(fun lb -> Parse.entries lb 0 []) diff --git a/src/meta.mli b/src/meta.mli new file mode 100644 index 00000000..18ac0c24 --- /dev/null +++ b/src/meta.mli @@ -0,0 +1,21 @@ +(** META file parsing/printing *) + +open! Import + +type t = + { name : string + ; entries : entry list + } + +and entry = + | Comment of string + | Var of string * predicate list * action * string + | Package of t + +and action = Set | Add + +and predicate = + | P of string (** Present *) + | A of string (** Absent *) + +val load : string -> entry list