nikic
d88a3c805f
remove $is_multitarget return in parseMultitargetExpression
...
Furthermore slightly reordered code thus removing redundant expect()
2010-12-20 19:06:42 +01:00
nikic
ad8375ac4b
One should only be able to assign to variables
2010-12-20 19:03:15 +01:00
nikic
06753220b9
remove unused $lineno variable
2010-12-20 19:01:33 +01:00
nikic
f1583ce353
change while(1) to while(true)
2010-12-20 19:01:23 +01:00
nikic
59f45ba11d
remove "(,)" hint from syntax error messages (the expect function will do that already)
2010-12-20 19:01:11 +01:00
nikic
f14e0a37ca
use the passed $token in isUnary and isBinary of ExpressionParser
2010-12-20 19:00:22 +01:00
Fabien Potencier
8e96487ada
changed error messages to be more friendly
2010-12-20 14:48:07 +01:00
Fabien Potencier
1621435b89
added support for functions
2010-12-19 19:48:02 +01:00
Fabien Potencier
20970419b4
removed support for foo.% which does not make sense
2010-12-14 16:23:56 +01:00
Fabien Potencier
3c01290c66
fixed usage of operators as method names (like is, in, and not)
2010-12-14 15:20:49 +01:00
Fabien Potencier
c202b2891f
enhanced error messages when an unexpected token is parsed in an expression
2010-12-14 09:47:56 +01:00
Fabien Potencier
4505200d9f
changed array/hashes notation
2010-12-14 09:33:07 +01:00
Fabien Potencier
031bf84b25
fixed parentheses placement for the ternary operator
2010-12-02 14:33:10 +01:00
Arnaud Le Blanc
7284fa9829
fix parsing of postfix expressions
2010-11-29 08:05:26 +01:00
Fabien Potencier
dc71bf1a82
made operators configurable
2010-11-26 20:57:53 +01:00
Fabien Potencier
9d8583efcc
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.
2010-11-26 16:35:59 +01:00
Arnaud Le Blanc
15e46e598d
Changed Twig_Node_Expression_Filter to accept only one filter
...
Chained filters are now represented by nested
Twig_Node_Expression_Filter nodes internally.
This makes it easier to analyse the tree
2010-11-19 08:06:32 +01:00
Fabien Potencier
7ea98b6c90
moved all exceptions to Twig_Error_*
2010-11-07 22:18:31 +01:00
Fabien Potencier
011e727b22
fixed documentation and added infix notation for in (already supported for is)
2010-11-07 14:21:10 +01:00
Fabien Potencier
2d1b78e849
removed @version phpdoc attribute
2010-11-07 09:26:25 +01:00
Fabien Potencier
47c44e477c
fixed is operator (lexer did not tokenize 'foo.isactive' properly -- closes #102 )
2010-08-17 07:50:52 +02:00
Fabien Potencier
5d6e7e2e01
added 'test' feature via the 'is' operator ( closes #88 )
2010-08-13 16:22:54 +02:00
Fabien Potencier
68b966516c
made parseArguments autonomous
2010-06-08 11:38:55 +02:00
Fabien Potencier
3c22324909
made parseArrayExpression autonomous
2010-06-08 11:23:30 +02:00
Fabien Potencier
dc37698ce0
changed order of Twig_Node_Expression_GetAttr constructor arguments
2010-06-07 14:28:22 +02:00
Fabien Potencier
f2bb0aa911
made Resource::getAttribute() more generic (WIP)
2010-06-07 10:41:15 +02:00
Fabien Potencier
56318ee4a8
made a big refactoring of Twig internals (and added a bunch of unit tests and phpdoc, fixes #53 )
2010-06-03 08:12:58 +02:00
Fabien Potencier
438bc40c87
tweaked an error message
2010-05-28 13:39:47 +02:00
Fabien Potencier
4d8fc51112
changed coding standards
2010-05-11 10:38:48 +02:00
fabien
575ed89d19
added the // operator (like in Jinja2, closes #44 )
...
git-svn-id: http://svn.twig-project.org/trunk@208 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2010-01-06 08:19:36 +00:00
fabien
7f6f7bb287
added support for a trailing , when defining arrays
...
git-svn-id: http://svn.twig-project.org/trunk@196 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-22 07:35:57 +00:00
fabien
2ab4dd5be0
added the .. operator as a syntactic sugar for the range filter when the step is 1
...
git-svn-id: http://svn.twig-project.org/trunk@173 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 15:13:38 +00:00
fabien
95d5cefdd7
added the in operator
...
git-svn-id: http://svn.twig-project.org/trunk@170 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 13:03:07 +00:00
fabien
ee5c9d9363
added support for arrays ( closes #50 )
...
git-svn-id: http://svn.twig-project.org/trunk@162 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 10:54:01 +00:00
fabien
69de38fb5c
made unexpected token exception more verbose
...
git-svn-id: http://svn.twig-project.org/trunk@158 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-12-13 08:12:07 +00:00
fabien
c7e8e88cc9
added support for expression for the set tag
...
git-svn-id: http://svn.twig-project.org/trunk@112 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-11-05 17:18:08 +00:00
fabien
22a5723159
changed the filter tag to allow chained filters
...
git-svn-id: http://svn.twig-project.org/trunk@75 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-10-18 22:52:37 +00:00
fabien
7fa1167b2d
added support for method calls with arguments
...
git-svn-id: http://svn.twig-project.org/trunk@35 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-10-12 17:05:12 +00:00
fabien
fd0646e4cf
initial commit
...
git-svn-id: http://svn.twig-project.org/trunk@4 93ef8e89-cb99-4229-a87c-7fa0fa45744b
2009-10-07 21:21:11 +00:00