[limb-svn] r6327 - 3.x/trunk/limb/macro/src

svn at limb-project.com svn at limb-project.com
Thu Sep 20 23:09:37 MSD 2007


Author: pachanga
Date: 2007-09-20 23:09:37 +0400 (Thu, 20 Sep 2007)
New Revision: 6327
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6327

Removed:
   3.x/trunk/limb/macro/src/lmbMacroLiteralParsingState.class.php
Modified:
   3.x/trunk/limb/macro/src/lmbMacroParser.class.php
Log:
-- removing lmbMacroLiteralParsingState since it's not required yet

Deleted: 3.x/trunk/limb/macro/src/lmbMacroLiteralParsingState.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroLiteralParsingState.class.php	2007-09-20 18:59:19 UTC (rev 6326)
+++ 3.x/trunk/limb/macro/src/lmbMacroLiteralParsingState.class.php	2007-09-20 19:09:37 UTC (rev 6327)
@@ -1,75 +0,0 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com 
- * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
- */
-
-require_once('limb/macro/src/lmbMacroTokenizerListener.interface.php');
-require_once('limb/macro/src/lmbMacroBaseParsingState.class.php');
-
-/**
- * class lmbMacroLiteralParsingState.
- *
- * @package macro
- * @version $Id$
- */
-class lmbMacroLiteralParsingState extends lmbMacroBaseParsingState  implements lmbMacroTokenizerListener
-{
-  protected $literal_tag;
-
-  function setLiteralElement($tag)
-  {
-    $this->literal_tag = $tag;
-  }
-
-  function getLiteralElement()
-  {
-    return $this->literal_tag;
-  }
-
-  function startElement($tag, $attrs)
-  {
-    $location = $this->parser->getCurrentLocation();
-    $this->tree_builder->addTextNode('<%' . $tag . $this->getAttributeString($attrs) . '%>');
-  }
-
-  function endElement($tag)
-  {
-    $location = $this->parser->getCurrentLocation();
-    if ($this->literal_tag == $tag)
-      $this->_closeLiteralState($location);
-    else
-      $this->tree_builder->addTextNode('<%/' . $tag . '%>');
-  }
-
-  protected function _closeLiteralState($location)
-  {
-    $this->tree_builder->popExpectedlmbMacroElement($this->literal_tag, $location);
-    $this->tree_builder->popNode();
-    $this->parser->changeToComponentParsingState();
-  }
-
-  function emptyElement($tag, $attrs)
-  {
-    $this->tree_builder->addTextNode('<%' . $tag . $this->getAttributeString($attrs) . ' /%>');
-  }
-
-  function characters($text)
-  {
-    $this->tree_builder->addTextNode($text);
-  }
-
-  function unexpectedEOF($text)
-  {
-    $this->tree_builder->addTextNode($text);
-  }
-
-  function invalidEntitySyntax($text)
-  {
-    $this->tree_builder->addTextNode($text);
-  }
-}
-

Modified: 3.x/trunk/limb/macro/src/lmbMacroParser.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroParser.class.php	2007-09-20 18:59:19 UTC (rev 6326)
+++ 3.x/trunk/limb/macro/src/lmbMacroParser.class.php	2007-09-20 19:09:37 UTC (rev 6327)
@@ -10,7 +10,6 @@
 lmb_require('limb/macro/src/lmbMacroTokenizer.class.php');
 lmb_require('limb/macro/src/lmbMacroPreprocessor.class.php');
 lmb_require('limb/macro/src/lmbMacroTokenizerListener.interface.php');
-lmb_require('limb/macro/src/lmbMacroLiteralParsingState.class.php');
 lmb_require('limb/macro/src/lmbMacroTagParsingState.class.php');
 
 /**
@@ -22,8 +21,8 @@
 class lmbMacroParser implements lmbMacroTokenizerListener
 {
   protected $active_parsing_state;
+
   protected $tag_parsing_state;
-  protected $literal_parsing_state;
 
   /**
    * @var lmbMacroTreebuilder
@@ -46,7 +45,6 @@
     $this->template_locator = $template_locator;
 
     $this->tag_parsing_state = $this->_createTagParsingState($tag_dictionary);
-    $this->literal_parsing_state = $this->_createLiteralParsingState();
   }
 
   function getCurrentLocation()
@@ -54,18 +52,11 @@
     return $this->tokenizer->getCurrentLocation();
   }
 
-  // for testing purposes
   protected function _createTagParsingState($tag_dictionary)
   {
     return new lmbMacroTagParsingState($this, $this->tree_builder, $tag_dictionary);
   }
 
-  // for testing purposes
-  protected function _createLiteralParsingState()
-  {
-    return new lmbMacroLiteralParsingState($this, $this->tree_builder);
-  }
-
   /**
   * Used to parse the source template.
   * Initially invoked by the CompileTemplate function,
@@ -112,15 +103,8 @@
     $this->active_parsing_state = $this->tag_parsing_state;
   }  
 
-  function changeToLiteralParsingState($tag)
-  {
-    $this->active_parsing_state = $this->literal_parsing_state;
-    $this->active_parsing_state->setLiteralTag($tag);
-  }
-  
   function setTemplateLocator($template_locator)
   {
-    $this->literal_parsing_state->setTemplateLocator($template_locator);
     $this->tag_parsing_state->setTemplateLocator($template_locator);
   }  
 



More information about the limb-svn mailing list