added meta.mli

This commit is contained in:
Jeremie Dimino 2016-11-13 10:03:07 +00:00
parent c9fddcbb77
commit de3314049f
2 changed files with 24 additions and 4 deletions

View File

@ -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 [])

21
src/meta.mli Normal file
View File

@ -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