Up

module OpamFilter

: sig

Manage filters

#
val to_string : OpamTypes.filter -> string

Pretty-print

#
type env = OpamTypes.full_variable -> OpamTypes.variable_contents option

Type of filter environment.

#
val contents_of_variable : env -> OpamTypes.full_variable -> OpamTypes.variable_contents option

Return the contents of a variable. Return None if the variable is not defined in the given environment.

#
val contents_of_variable_exn : env -> OpamTypes.full_variable -> OpamTypes.variable_contents

Return the contents of a variable. Raises Not_found if the variable is not defined in the given environment.

#
val substitute_string : env -> string -> string

Substitute a string.

#
val substitute_file : env -> OpamTypes.basename -> unit

Substitute a file.

#
val eval : env -> OpamTypes.filter -> bool

Evaluate a filter. May raise Not_found if the filter contains undefined variables

#
val eval_opt : env -> OpamTypes.filter option -> bool

Evaluate an optional filter.

#
val commands : env -> OpamTypes.command list -> string list list

Filter a list of commands by:

  • evaluating the substitution strings; and
  • removing the commands with a filter evaluating to "false"
end