Module Ninja_utils.Expr

Helper module to build ninja expressions.

type t =
| Lit of string
| Var of string
| Seq of t list

Represents a ninja expression. Which could be either a literal, a variable references ($_) or a sequence of sub-expressions.

Note: for now, there are no visible differences between an Expr.Seq and a list of Expr.t, indeed, in both cases, one space is added between each expression -- resp. sub-expression. The difference only comes from the semantic: an Expr.Seq is a unique Ninja expression.

val format : Stdlib.Format.formatter -> t -> unit

format fmt exp outputs in fmt the string representation of the ninja expression exp.

val format_list : Stdlib.Format.formatter -> t list -> unit

format fmt ls outputs in fmt the string representation of a list ls of ninja expressions exp by adding a space between each expression.