Commit Graph

3 Commits

Author SHA1 Message Date
Stephen Kelly b3d8f5dab7 GenEx: Parse comma after colon tokens specially
Otherwise the comma is treated as plain text by ParseContent.

$<STREQUAL:,> should be valid and true.
$<STREQUAL:,something> should be valid and false.

$<STREQUAL:,,> should be non-valid as it is 3 parameters.
$<STREQUAL:something,,> should be non-valid as it is 3 parameters.

Additionally, this allows reporting the correct error for other
expressions. For example $<TARGET_PROPERTY:,> should be invalid
because it has an empty target and empty property. It shouldn't
attempt to read the property ',' on the 'implicit this' target.
2012-10-09 08:26:43 -04:00
Stephen Kelly f1eacf0e07 cmGeneratorExpression: Re-write for multi-stage evaluation
The expressions may be parsed and then cached and evaluated multiple
times.  They are evaluated lazily so that literals such as ',' can be
treated as universal parameter separators, and can be processed from
results without appearing literally, and without interfering with the
parsing/evaluation of the entire expression.
2012-09-18 17:02:23 -04:00
Brad King ebf05abda1 Add boolean generator expressions
Add generator expressions that combine and use boolean test results:

 $<0:...>         = empty string (ignores "...")
 $<1:...>         = content of "..."
 $<AND:?[,?]...>  = '1' if all '?' are '1', else '0'
 $<OR:?[,?]...>   = '0' if all '?' are '0', else '1'
 $<NOT:?>         = '0' if '?' is '1', else '1'

These will be useful to evaluate (future) boolean query expressions and
condition content on the results.  Include tests and documentation.
2012-08-15 11:44:49 -04:00