module OpamFilter: sig
.. end
Manage filters
val to_string : OpamTypes.filter -> string
Pretty-print
val fold_down_left : ('a -> OpamTypes.filter -> 'a) -> 'a -> OpamTypes.filter -> 'a
Folds on the tree of a filter
val variables : OpamTypes.filter -> OpamTypes.full_variable list
Returns all the variables appearing in a filter (including the ones within
string interpolations
type
env = OpamTypes.full_variable -> OpamTypes.variable_contents option
Type of filter environment.
type
fident = OpamTypes.name list * OpamTypes.variable * (string * string) option
The type of filter idents with (optionally multiple) qualifying package
names and optional string converter
val expand_string : env -> string -> string
Rewrites string interpolations within a string
val eval : ?default:OpamTypes.variable_contents ->
env -> OpamTypes.filter -> OpamTypes.variable_contents
Computes the value of a filter. May raise Failure
if default
isn't
provided
val eval_to_bool : ?default:bool -> env -> OpamTypes.filter -> bool
Like to_value
but casts the result to a bool. Raises Invalid_argument
if
not a valid bool and no default supplied.
val opt_eval_to_bool : env -> OpamTypes.filter option -> bool
Same as eval_to_bool
, but takes an option as filter and returns always
true
on None
, false
when the filter is Undefined
. This is the
most common behaviour for using "filters" for filtering
val eval_to_string : ?default:string -> env -> OpamTypes.filter -> string
Like to_value
but casts the result to a string
val ident_of_var : OpamTypes.full_variable -> fident
Wraps a full_variable into a fident accessor
val ident_value : ?default:OpamTypes.variable_contents ->
env -> fident -> OpamTypes.variable_contents
Resolves a filter ident. Like eval
, may raise Failure if no default is
provided
val ident_string : ?default:string -> env -> fident -> string
Like ident_value
, but casts the result to a string
val ident_bool : ?default:bool -> env -> fident -> bool
Like ident_value
, but casts the result to a bool
val expand_interpolations_in_file : env -> OpamTypes.basename -> unit
Rewrites basename
.in to basename
, expanding interpolations
val commands : env -> OpamTypes.command list -> string list list
Processes filters evaluation in a command list: parameter expansion and
conditional filtering
val single_command : env -> OpamTypes.arg list -> string list
Process a simpler command, without filters
val commands_variables : OpamTypes.command list -> OpamTypes.full_variable list
Extracts variables appearing in a list of commands