rewrote expression parser with a new algorithm to limit the depth of nested calls
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 26 Nov 2010 09:35:49 +0000 (10:35 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 26 Nov 2010 15:35:59 +0000 (16:35 +0100)
commit9d8583efcc236f7c8bc357ef0c122c9246ef5115
tree7011c6cb47f711280e87dc47a693ba3cf21c0f4b
parent515741a8e05bb5265f179e8c5ae4cb808b280ebd
rewrote expression parser with a new algorithm to limit the depth of nested calls

This change has no impact for the end user, but many internal benefits:

* less nested calls (was the primary reason for the change as xdebug limits the depth of nested calls);
* less code;
* code is much cleaner (I have removed all the parsing "hacks");
* faster;
* more flexible (we will now be able to expose an API to add new operators);
* easier to maintain.
21 files changed:
CHANGELOG
doc/02-Twig-for-Template-Designers.markdown
lib/Twig/ExpressionParser.php
lib/Twig/Extension/Core.php
lib/Twig/Lexer.php
lib/Twig/Node/Expression/Binary/Equal.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/Greater.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/GreaterEqual.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/In.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/Less.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/LessEqual.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/NotEqual.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/NotIn.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/Power.php [new file with mode: 0644]
lib/Twig/Node/Expression/Binary/Range.php [new file with mode: 0644]
lib/Twig/Node/Expression/Compare.php [deleted file]
lib/Twig/Token.php
lib/Twig/TokenParser/For.php
test/Twig/Tests/Fixtures/expressions/comparison.test
test/Twig/Tests/Fixtures/filters/in.test [deleted file]
test/Twig/Tests/Node/Expression/CompareTest.php [deleted file]