dune/src/string_with_vars.mli

24 lines
571 B
OCaml
Raw Normal View History

2016-12-23 15:32:23 +00:00
(** String with variables of the form ${...} or $(...)
Variables cannot contain "${", "$(", ")" or "}". For instance in "$(cat ${x})", only
"${x}" will be considered a variable, the rest is text. *)
2016-12-02 13:54:32 +00:00
open Import
type t
2017-02-25 17:53:39 +00:00
val t : t Sexp.Of_sexp.t
2017-02-21 17:13:30 +00:00
val sexp_of_t : t -> Sexp.t
2016-12-02 13:54:32 +00:00
2017-05-05 11:26:56 +00:00
val loc : t -> Loc.t
val of_string : loc:Loc.t -> string -> t
val raw : loc:Loc.t -> string -> t
2016-12-02 13:54:32 +00:00
val just_a_var : t -> string option
2016-12-02 13:54:32 +00:00
val vars : t -> String_set.t
2017-05-05 11:26:56 +00:00
val fold : t -> init:'a -> f:('a -> Loc.t -> string -> 'a) -> 'a
2016-12-02 13:54:32 +00:00
val expand : t -> f:(string -> string option) -> string