added meta.mli
This commit is contained in:
parent
c9fddcbb77
commit
de3314049f
|
@ -13,9 +13,8 @@ and entry =
|
||||||
and action = Set | Add
|
and action = Set | Add
|
||||||
|
|
||||||
and predicate =
|
and predicate =
|
||||||
| P of string (* Present *)
|
| P of string
|
||||||
| A of string (* Absent *)
|
| A of string
|
||||||
|
|
||||||
|
|
||||||
module Parse = struct
|
module Parse = struct
|
||||||
let error = lex_error
|
let error = lex_error
|
||||||
|
@ -91,6 +90,6 @@ module Parse = struct
|
||||||
error lb "'package' or variable name expected"
|
error lb "'package' or variable name expected"
|
||||||
end
|
end
|
||||||
|
|
||||||
let parse fn =
|
let load fn =
|
||||||
with_lexbuf_from_file fn ~f:(fun lb ->
|
with_lexbuf_from_file fn ~f:(fun lb ->
|
||||||
Parse.entries lb 0 [])
|
Parse.entries lb 0 [])
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue