Method FromString(string)
Builds a predicate from a condition string. Three shapes, one rule each:
a ${...} template is interpolated to a string and read for truthiness;a condition carrying a comparison or word-logic operator is a boolean expression
and is parsed by the AST parser, which tokenises the input: whitespace between tokens
carries no meaning (header.a>10, header.a > 10 and a tab- or
newline-separated form are one expression) and an operator inside a quoted literal is
not an operator;anything else is a value read for truthiness, which keeps a bare accessor such as
property.cfg.enabled resolving exactly as it always has.
Compilation happens here, while the route is being built, so a condition the parser cannot
accept fails at build time instead of turning into a constant answer on live traffic.
public static IPredicate FromString(string condition)