logo       

4077 - in trunk/Template/src/parsers: source_to_tst/implementations tst_to_: msg#00247

web.ezcomponents.cvs

Subject: 4077 - in trunk/Template/src/parsers: source_to_tst/implementations tst_to_ast/implementations [eZComponents: Trunk]

Author: Raymond Bosman
Date: 2006-11-27 13:42:09 +0100 (Mon, 27 Nov 2006)
New Revision: 4077

Log:
- Fixed issue #009464: Weird error messages on calculations with
multidimensional arrays.
# Need more tests to see if the issue is really fixed.
# Add to Changelog, after the tests are committed.

Modified:
trunk/Template/src/parsers/source_to_tst/implementations/expression.php

trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php

Modified:
trunk/Template/src/parsers/source_to_tst/implementations/expression.php
===================================================================
--- trunk/Template/src/parsers/source_to_tst/implementations/expression.php
2006-11-27 10:50:25 UTC (rev 4076)
+++ trunk/Template/src/parsers/source_to_tst/implementations/expression.php
2006-11-27 12:42:09 UTC (rev 4077)
@@ -356,7 +356,7 @@
{
// Try the special array fetch operator
$operator = null;
- if ( $cursor->match( '[' ) )
+ while ( $cursor->match( '[' ) )
{
$this->findNextElement();

@@ -392,10 +392,9 @@

$this->currentOperator =
$this->parser->handleOperatorPrecedence( $this->currentOperator, $operator );
$this->lastCursor = clone $cursor;
- return true;
}

- return false;
+ return ($operator !== null);
}



Modified:
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php
===================================================================
---
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php
2006-11-27 10:50:25 UTC (rev 4076)
+++
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php
2006-11-27 12:42:09 UTC (rev 4077)
@@ -829,7 +829,21 @@

public function visitArrayFetchOperatorTstNode(
ezcTemplateArrayFetchOperatorTstNode $type )
{
- return $this->createBinaryOperatorAstNode( $type, new
ezcTemplateArrayFetchOperatorAstNode(), false );
+ $node = new ezcTemplateArrayFetchOperatorAstNode();
+ $node->appendParameter( $type->parameters[0]->accept( $this ) );
+ $node->appendParameter( $type->parameters[1]->accept( $this ) );
+
+ $nrOfParameters = sizeof( $type->parameters );
+
+ for( $i = 2; $i < $nrOfParameters; $i++)
+ {
+ $tmp = new ezcTemplateArrayFetchOperatorAstNode();
+ $tmp->appendParameter( $node );
+ $tmp->appendParameter( $type->parameters[$i]->accept( $this ));
+ $node = $tmp;
+ }
+
+ return $node;
}

public function visitArrayAppendOperatorTstNode(
ezcTemplateArrayAppendOperatorTstNode $type )



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise