package opam-format
Install
dune-project
Dependency
Authors
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
md5=1e55c234fa09e678e8115a31f3ec2a05
sha512=d71c362d70a6b6cb9fe54cc43bfbea8079cca05d4721a7dda951196f543a1ff5af81399a246e0cd68bc590c7bdca388d96c7127217ed637261957047ce725516
doc/opam-format/OpamFormat/I/index.html
Module OpamFormat.ISource
val map_file :
(OpamTypes.opamfile_item list, 'a) OpamPp.t ->
(OpamTypes.opamfile, OpamTypes.filename * 'a) OpamPp.tSuitable for the fields sections argument, when the sections are anonymous (section_name = None)
val fields :
?name:string ->
empty:'a ->
?sections:
('a, (string option * OpamTypes.opamfile_item list) list) fields_def ->
?mandatory_fields:string list ->
('a, OpamTypes.value) fields_def ->
(OpamTypes.opamfile_item list, 'a * (string * OpamPp.bad_format) list)
OpamPp.tParses an item list into a record using a fields_def; errors in a field cause the field to be ignored, and are aggregated into the returned field, bad_format list. Errors are ignored when printing back.
val show_errors :
?name:string ->
?strict:bool ->
?condition:('a -> bool) ->
unit ->
('a * (string * OpamPp.bad_format) list, 'a) OpamPp.tIntended to be piped after fields. If the errors list is non-empty, this raises Bad_format_list if strict, and otherwise prints warnings for all the errors. The errors are then dropped when parsing, and initialised to empty when printing. strict is taken from the global settings if unspecified. condition may be added to only show the errors when it returns true, and only log them otherwise.
val on_errors :
?name:string ->
('a -> (string * OpamPp.bad_format) -> 'a) ->
('a * (string * OpamPp.bad_format) list, 'a) OpamPp.tIntended to be piped after fields, this processes the given function on the errors, then drops them when parsing. When printing, just sets empty errors.
val partition_fields :
(string -> bool) ->
(OpamTypes.opamfile_item list,
OpamTypes.opamfile_item list * OpamTypes.opamfile_item list)
OpamPp.tPartitions items in an opamfile base on a condition on the variable names
val partition :
(OpamTypes.opamfile_item -> bool) ->
(OpamTypes.opamfile_item list,
OpamTypes.opamfile_item list * OpamTypes.opamfile_item list)
OpamPp.tPartitions items in an opamfile base on a generic condition on the items
val field :
string ->
(pos:OpamTypes.pos -> OpamTypes.value -> 'a) ->
(OpamTypes.opamfile_item list, 'a option * OpamTypes.opamfile_item list)
OpamPp.tParse a single field from a file, return the result and the unchanged item list. The single field is ignored when printing back.
val section :
string ->
(OpamTypes.opamfile_item, string option * OpamTypes.opamfile_item list)
OpamPp.tParse a single section with the given "kind", towards its name and contents
val extract_field :
string ->
(OpamTypes.opamfile_item list,
OpamTypes.value option * OpamTypes.opamfile_item list)
OpamPp.tExtracts a single item with the given variable name from an item list. The item is removed from the returned item list, and the two are re-combined when printing
val check_opam_version :
?optional:bool ->
?f:(OpamTypes.opam_version -> bool) ->
unit ->
(OpamTypes.opamfile_item list, OpamTypes.opamfile_item list) OpamPp.tChecks the opam_version field; otherwise the identity
Signature handling (wip)
A signature is a keyid, an algorithm and the signature proper
val signed :
check:(signature list -> string -> bool) ->
(OpamTypes.opamfile_item list, signature list * OpamTypes.opamfile_item list)
OpamPp.tPp for signed files. Will assert fail if attempting to write a file with an invalid signature.