lyncode/jtwig — pull request #225 by thomas-p-wilson (2014-11-12 17:33:55+00:00)
Title: Updated list comprehension behaviour to support operating on expressions per #78

Per #78, Jtwig now supports list comprehension of expressions.

A couple of interesting points:

1. Just like Twig, numbers are preferred. If a character|string|object is used in conjunction with a number, the character|string|object will end up as a 0, which is typical for Twig.
1. Binary operations now check to ensure that the operator is only present a single time. This was to ensure that the double dot operator wouldn't be matched during parsing. This had no effect on unit or acceptance tests at the time of writing.
1. The expression parser has an added bit of goodness, the InValueStack class and associated rule methods. This allows rules to determine whether a given class is contained within a specific slice of the value stack. This was necessary in order to prevent the list comprehension rule from eagerly matching itself while trying to grab the left-side expression.