|
4114 - in trunk/Template: src/parsers/source_to_tst/implementations src/syn: msg#00287web.ezcomponents.cvs
Author: Raymond Bosman Date: 2006-11-28 16:22:53 +0100 (Tue, 28 Nov 2006) New Revision: 4114 Log: - Added test output. - Fixed problem that {else} and {elseif} used inside another block: eg {foreach} did not give an error. Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.in trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.in Modified: trunk/Template/src/parsers/source_to_tst/implementations/program.php trunk/Template/src/syntax_trees/tst/interfaces/tst_node.php trunk/Template/src/syntax_trees/tst/nodes/block.php trunk/Template/src/syntax_trees/tst/nodes/condition_body.php trunk/Template/tests/regression_tests/blocks/correct/matching_block_0090.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0041.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0042.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0043.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0044.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0045.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0046.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0047.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0048.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0049.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0050.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0051.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0052.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0053.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0054.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0055.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0056.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.out trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.out Modified: trunk/Template/src/parsers/source_to_tst/implementations/program.php =================================================================== --- trunk/Template/src/parsers/source_to_tst/implementations/program.php 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/src/parsers/source_to_tst/implementations/program.php 2006-11-28 15:22:53 UTC (rev 4114) @@ -77,7 +77,6 @@ $this->lastCursor->copy( $cursor ); if ( !$this->parseRequiredType( 'Block', $this->startCursor, false ) ) { - // This will cause handleSuccessfulResult() to be called return false; } $this->startCursor->copy( $cursor ); @@ -182,7 +181,6 @@ { foreach ( $elements as $element ) { - if ( $element instanceof ezcTemplateBlockTstNode && $element->isClosingBlock ) { // Check for closing of current block @@ -193,20 +191,22 @@ } else { + // This method throws an exception if the node cannot be attached. + $element->canAttachToParent( $this->lastBlock ); - $this->lastBlock->handleElement( $element ); + $this->lastBlock->handleElement( $element ); - if ( $element instanceof ezcTemplateBlockTstNode && $element->isNestingBlock) - { + if ( $element instanceof ezcTemplateBlockTstNode && $element->isNestingBlock) + { - // No special handling required so we check if the element - // is a nesting block and should start a new nesting level + // No special handling required so we check if the element + // is a nesting block and should start a new nesting level - $element->parentBlock = $this->lastBlock; - $this->lastBlock = $element; + $element->parentBlock = $this->lastBlock; + $this->lastBlock = $element; - $this->parser->symbolTable->increaseScope(); - } + $this->parser->symbolTable->increaseScope(); + } } } } Modified: trunk/Template/src/syntax_trees/tst/interfaces/tst_node.php =================================================================== --- trunk/Template/src/syntax_trees/tst/interfaces/tst_node.php 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/src/syntax_trees/tst/interfaces/tst_node.php 2006-11-28 15:22:53 UTC (rev 4114) @@ -148,7 +148,11 @@ return false; } + public function canAttachToParent( $parentElement ) + { + } + /** * The accept part for the visitor. * Modified: trunk/Template/src/syntax_trees/tst/nodes/block.php =================================================================== --- trunk/Template/src/syntax_trees/tst/nodes/block.php 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/src/syntax_trees/tst/nodes/block.php 2006-11-28 15:22:53 UTC (rev 4114) @@ -213,6 +213,11 @@ return false; } + public function canAttachToParent( $parentElement ) + { + //echo ("Checking whether ". get_class( $this ) . " can be attached to: " . get_class( $parentElement ) . "\n" ); + } + /** * Passes control of $element to the current block for special handling. * Modified: trunk/Template/src/syntax_trees/tst/nodes/condition_body.php =================================================================== --- trunk/Template/src/syntax_trees/tst/nodes/condition_body.php 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/src/syntax_trees/tst/nodes/condition_body.php 2006-11-28 15:22:53 UTC (rev 4114) @@ -43,5 +43,22 @@ return array( 'condition' => $this->condition, 'children' => $this->children ); } + + public function canAttachToParent( $parentElement ) + { + if( !$parentElement instanceof ezcTemplateIfConditionTstNode ) + { + if ( $parentElement instanceof ezcTemplateProgramTstNode ) + { + throw new ezcTemplateParserException( $this->source, $this->startCursor, $this->startCursor, + "{" . $this->name . "} can only be a child of an {if} block." ); + } + + throw new ezcTemplateParserException( $this->source, $this->startCursor, $this->startCursor, + "The block {" . $this->name . "} cannot be a sub-block of {".$parentElement->name."}. {".$this->name."} can only be a child of an {if} block." ); + } + } + + } ?> Property changes on: trunk/Template/tests/regression_tests/blocks/correct/matching_block_0090.out ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0041.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0041.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0041.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0042.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0042.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0042.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0043.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0043.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0043.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0044.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0044.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0044.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0045.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0045.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0045.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0046.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0046.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0046.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0047.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0047.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0047.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0048.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0048.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0048.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:8: Unexpected block {elseif} at this position. Some blocks can only be used inside other blocks. +mock:3:8: {elseif} can only be a child of an {if} block. {elseif $foo} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0049.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0049.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0049.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0050.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0050.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0050.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0051.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0051.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0051.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0052.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0052.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0052.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0053.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0053.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0053.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0054.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0054.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0054.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0055.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0055.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0055.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0056.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0056.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0056.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:3:6: Unexpected block {else} at this position. Some blocks can only be used inside other blocks. +mock:3:6: {else} can only be a child of an {if} block. {else} ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0121.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0121.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:7:11: Open and close block do not match: {elseif} and {/foreach} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. -{/foreach} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0122.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/foreach} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0122.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:15: Open and close block do not match: {elseif} and {/foreach} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/foreach} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0123.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/while} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0123.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:13: Open and close block do not match: {elseif} and {/while} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/while} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0124.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/delimiter} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0124.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:17: Open and close block do not match: {elseif} and {/delimiter} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/delimiter} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0125.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/if} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0125.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:10: Open and close block do not match: {elseif} and {/if} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/if} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0126.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/switch} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0126.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:14: Open and close block do not match: {elseif} and {/switch} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/switch} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0127.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/case} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0127.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:12: Open and close block do not match: {elseif} and {/case} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/case} + {elseif $foo} ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0128.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {elseif $foo} + {$foo} + {/default} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0128.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:15: Open and close block do not match: {elseif} and {/default} +mock:4:12: The block {elseif} cannot be a sub-block of {foreach}. {elseif} can only be a child of an {if} block. - {/default} - ^ + {elseif $foo} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0129.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0129.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:7:11: Open and close block do not match: {else} and {/foreach} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. -{/foreach} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0130.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/foreach} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0130.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:15: Open and close block do not match: {else} and {/foreach} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/foreach} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0131.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/while} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0131.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:13: Open and close block do not match: {else} and {/while} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/while} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0132.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/delimiter} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0132.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:17: Open and close block do not match: {else} and {/delimiter} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/delimiter} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0133.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/if} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0133.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:10: Open and close block do not match: {else} and {/if} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/if} + {else} ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0134.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/switch} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0134.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:14: Open and close block do not match: {else} and {/switch} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/switch} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0135.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/case} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0135.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:12: Open and close block do not match: {else} and {/case} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/case} - ^ + {else} + ^ Added: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.in =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.in 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.in 2006-11-28 15:22:53 UTC (rev 4114) @@ -0,0 +1,8 @@ +{* file: non_matching_block_0136.in *} +{var $foo = 1, $_false = false, $array = array( 1, 2 )} +{foreach $array as $bar} + {else} + {$foo} + {/default} +{/foreach} + Property changes on: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.in ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.out =================================================================== --- trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.out 2006-11-28 14:15:57 UTC (rev 4113) +++ trunk/Template/tests/regression_tests/blocks/incorrect/non_matching_block_0136.out 2006-11-28 15:22:53 UTC (rev 4114) @@ -1,4 +1,4 @@ -mock:6:15: Open and close block do not match: {else} and {/default} +mock:4:10: The block {else} cannot be a sub-block of {foreach}. {else} can only be a child of an {if} block. - {/default} - ^ + {else} + ^ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | 4113 - trunk/EventLog/docs [eZComponents: Trunk]: 00287, Alexandru Stanoi |
|---|---|
| Next by Date: | 4115 - in trunk/Template: src/parsers/source_to_tst/implementations src/parsers/tst_to_ast/implementations src/syntax_trees/tst/nodes tests/regression_tests/blocks/incorrect tests/regression_tests/foreach/incorrect [eZComponents: Trunk]: 00287, Raymond Bosman |
| Previous by Thread: | 4113 - trunk/EventLog/docs [eZComponents: Trunk]i: 00287, Alexandru Stanoi |
| Next by Thread: | 4115 - in trunk/Template: src/parsers/source_to_tst/implementations src/parsers/tst_to_ast/implementations src/syntax_trees/tst/nodes tests/regression_tests/blocks/incorrect tests/regression_tests/foreach/incorrect [eZComponents: Trunk]: 00287, Raymond Bosman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |