- Improved variables support
commitf1a136c0062a2f9c8a1a7704736e2d42f61b3ebd
authorCésar D. Rodas <crodas@php.net>
Thu, 5 Aug 2010 06:12:25 +0000 (5 02:12 -0400)
committerCésar D. Rodas <crodas@php.net>
Thu, 5 Aug 2010 06:12:25 +0000 (5 02:12 -0400)
treea56e1117f54ae4762ba316e9e444d7a85eba0219
parent532a8afe61515c39322967abc9de50158695d3d5
- Improved variables support
     *  Variables context
     *
     *  Added two functions which are useful to detect if a variable
     *  separated by dot (foo.bar) is an array or object. To avoid
     *  overhead we decide it at compile time, rather than
     *  ask over and over at rendering time.
     *
     *  foo.bar:
     *      + If foo exists at compile time,
     *        and it is an array, it would be foo['bar']
     *        otherwise it'd be foo->bar.
     *      + If foo don't exists at compile time,
     *        it would be foo->bar if the compiler option
     *        dot_as_object is TRUE (by default) otherwise
     *        it'd be foo['bar']
     *
     *  @author crodas
     *  @author gallir (ideas)
- Disabled unitest for CLI (currently it is not important)
13 files changed:
lib/Haanga.php
lib/Haanga/Compiler.php
lib/Haanga/Compiler/Lexer.lex
lib/Haanga/Compiler/Lexer.php
lib/Haanga/Compiler/Parser.out
lib/Haanga/Compiler/Parser.php
lib/Haanga/Compiler/Parser.y
tests/assert_templates/object.tpl
tests/templateTest.php
tests/tmp/assert_templates_load.tpl.php
tests/tmp/assert_templates_loop.tpl.php
tests/tmp/assert_templates_regroup.tpl.php
tests/tmp/assert_templates_variable_existe.tpl.php