logo       

4086 - in trunk/Template/src: parsers/source_to_tst/implementations syntax_: msg#00256

web.ezcomponents.cvs

Subject: 4086 - in trunk/Template/src: parsers/source_to_tst/implementations syntax_trees/tst/nodes [eZComponents: Trunk]

Author: Raymond Bosman
Date: 2006-11-27 15:30:35 +0100 (Mon, 27 Nov 2006)
New Revision: 4086

Log:
- Fixed the case error message.

Modified:
trunk/Template/src/parsers/source_to_tst/implementations/program.php
trunk/Template/src/parsers/source_to_tst/implementations/switch_condition.php
trunk/Template/src/syntax_trees/tst/nodes/case.php
trunk/Template/src/syntax_trees/tst/nodes/switch.php

Modified: trunk/Template/src/parsers/source_to_tst/implementations/program.php
===================================================================
--- trunk/Template/src/parsers/source_to_tst/implementations/program.php
2006-11-27 13:55:16 UTC (rev 4085)
+++ trunk/Template/src/parsers/source_to_tst/implementations/program.php
2006-11-27 14:30:35 UTC (rev 4086)
@@ -224,7 +224,7 @@
// Check for closing blocks that do not belong to an opening block.
if ( $this->lastBlock->parentBlock === null &&
$element->isClosingBlock )
{
- throw new ezcTemplateParserException( $this->parser->source,
$this->startCursor, $this->currentCursor,
+ throw new ezcTemplateParserException( $this->parser->source,
$this->startCursor, $this->startCursor,
"Found closing block {/". $element->name."} without an opening
block." );
}


Modified:
trunk/Template/src/parsers/source_to_tst/implementations/switch_condition.php
===================================================================
---
trunk/Template/src/parsers/source_to_tst/implementations/switch_condition.php
2006-11-27 13:55:16 UTC (rev 4085)
+++
trunk/Template/src/parsers/source_to_tst/implementations/switch_condition.php
2006-11-27 14:30:35 UTC (rev 4086)
@@ -50,7 +50,7 @@
else
{
// Tricky: Skip the spaces and new lines. Next element should
be an case, or default.
- $this->findNextElement();
+ //$this->findNextElement();

$sw = new ezcTemplateCaseTstNode( $this->parser->source,
$this->startCursor, $cursor );
}
@@ -76,7 +76,7 @@
}

// Tricky: Skip the spaces and new lines. Next element should be
an case, or default.
- $this->findNextElement();
+ //$this->findNextElement();

$sw = new ezcTemplateSwitchTstNode( $this->parser->source,
$this->startCursor, $cursor );


Modified: trunk/Template/src/syntax_trees/tst/nodes/case.php
===================================================================
--- trunk/Template/src/syntax_trees/tst/nodes/case.php 2006-11-27 13:55:16 UTC
(rev 4085)
+++ trunk/Template/src/syntax_trees/tst/nodes/case.php 2006-11-27 14:30:35 UTC
(rev 4086)
@@ -34,6 +34,7 @@
{
parent::__construct( $source, $start, $end );
$this->conditions = array();
+ $this->name = "case";

$this->isNestingBlock = true;
}

Modified: trunk/Template/src/syntax_trees/tst/nodes/switch.php
===================================================================
--- trunk/Template/src/syntax_trees/tst/nodes/switch.php 2006-11-27
13:55:16 UTC (rev 4085)
+++ trunk/Template/src/syntax_trees/tst/nodes/switch.php 2006-11-27
14:30:35 UTC (rev 4086)
@@ -75,6 +75,11 @@
// It's okay, but ignore it.
return;
}
+ else
+ {
+ $trimmedLength = strlen( ltrim( $element->text ) );
+ $element->startCursor->advance( strlen($element->text) -
$trimmedLength );
+ }
}

throw new ezcTemplateParserException( $element->source,
$element->startCursor, $element->startCursor,
ezcTemplateSourceToTstErrorMessages::MSG_EXPECT_CASE_STATEMENT );



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

News | FAQ | advertise