mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== trunk =====
|
||||
12.08.2013
|
||||
- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149)
|
||||
|
||||
10.08.2013
|
||||
- bugfix a newline was eaten when a <?xml ... ?> was passed by a Smarty variable and caching was enabled (forum topic 24482)
|
||||
|
||||
|
@@ -1,393 +1,393 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty Internal Plugin Templateparser Parsetrees
|
||||
*
|
||||
* These are classes to build parsetrees in the template parser
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Thue Kristensen
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
abstract class _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Parser object
|
||||
* @var object
|
||||
*/
|
||||
public $parser;
|
||||
/**
|
||||
* Buffer content
|
||||
* @var mixed
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* Return buffer
|
||||
*
|
||||
* @return string buffer content
|
||||
*/
|
||||
abstract public function to_smarty_php();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A complete smarty tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_tag extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Saved block nesting level
|
||||
* @var int
|
||||
*/
|
||||
public $saved_block_nesting;
|
||||
|
||||
/**
|
||||
* Create parse tree buffer for Smarty tag
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data content
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
$this->saved_block_nesting = $parser->block_nesting_level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content
|
||||
*
|
||||
* @return string content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return complied code that loads the evaluated outout of buffer content into a temporary variable
|
||||
*
|
||||
* @return string template code
|
||||
*/
|
||||
public function assign_to_var()
|
||||
{
|
||||
$var = sprintf('$_tmp%d', ++$this->parser->prefix_number);
|
||||
$this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Code fragment inside a tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_code extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer for code fragment
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data content
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content in parentheses
|
||||
*
|
||||
* @return string content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return sprintf("(%s)", $this->data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Double quoted string inside a tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_doublequoted extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer for double quoted string subtrees
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param _smarty_parsetree $subtree parsetree buffer
|
||||
*/
|
||||
public function __construct($parser, _smarty_parsetree $subtree)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->subtrees[] = $subtree;
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Append buffer to subtree
|
||||
*
|
||||
* @param _smarty_parsetree $subtree parsetree buffer
|
||||
*/
|
||||
public function append_subtree(_smarty_parsetree $subtree)
|
||||
{
|
||||
$last_subtree = count($this->subtrees) - 1;
|
||||
if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
|
||||
if ($subtree instanceof _smarty_code) {
|
||||
$this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
|
||||
} elseif ($subtree instanceof _smarty_dq_content) {
|
||||
$this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
|
||||
} else {
|
||||
$this->subtrees[$last_subtree]->data .= $subtree->data;
|
||||
}
|
||||
} else {
|
||||
$this->subtrees[] = $subtree;
|
||||
}
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge subtree buffer content together
|
||||
*
|
||||
* @return string compiled template code
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
$code = '';
|
||||
foreach ($this->subtrees as $subtree) {
|
||||
if ($code !== "") {
|
||||
$code .= ".";
|
||||
}
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$more_php = $subtree->assign_to_var();
|
||||
} else {
|
||||
$more_php = $subtree->to_smarty_php();
|
||||
}
|
||||
|
||||
$code .= $more_php;
|
||||
|
||||
if (!$subtree instanceof _smarty_dq_content) {
|
||||
$this->parser->compiler->has_variable_string = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw chars as part of a double quoted string.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_dq_content extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer with string content
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data string section
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return content as double quoted string
|
||||
*
|
||||
* @return string doubled quoted string
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return '"' . $this->data . '"';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Template element
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_template_buffer extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Array of template elements
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $subtrees = Array();
|
||||
|
||||
/**
|
||||
* Create root of parse tree for template elements
|
||||
*
|
||||
* @param object $parser parse object
|
||||
*/
|
||||
public function __construct($parser)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append buffer to subtree
|
||||
*
|
||||
* @param _smarty_parsetree $subtree
|
||||
*/
|
||||
public function append_subtree(_smarty_parsetree $subtree)
|
||||
{
|
||||
$this->subtrees[] = $subtree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize and merge subtree buffers together
|
||||
*
|
||||
* @return string template code content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
$code = '';
|
||||
for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
|
||||
if ($key + 2 < $cnt) {
|
||||
if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
|
||||
$key = $key + 1;
|
||||
continue;
|
||||
}
|
||||
if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
|
||||
$key = $key + 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (substr($code, -1) == '<') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '?') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
|
||||
} elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ($this->parser->asp_tags && substr($code, -1) == '%') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '>') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (substr($code, -1) == '?') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '>') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$code .= $this->subtrees[$key]->to_smarty_php();
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* template text
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_text extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create template text buffer
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data text
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content
|
||||
*
|
||||
* @return strint text
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* template linebreaks
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_linebreak extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create buffer with linebreak content
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data linebreak string
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return linebrak
|
||||
*
|
||||
* @return string linebreak
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Smarty Internal Plugin Templateparser Parsetrees
|
||||
*
|
||||
* These are classes to build parsetrees in the template parser
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Thue Kristensen
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
abstract class _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Parser object
|
||||
* @var object
|
||||
*/
|
||||
public $parser;
|
||||
/**
|
||||
* Buffer content
|
||||
* @var mixed
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* Return buffer
|
||||
*
|
||||
* @return string buffer content
|
||||
*/
|
||||
abstract public function to_smarty_php();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A complete smarty tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_tag extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Saved block nesting level
|
||||
* @var int
|
||||
*/
|
||||
public $saved_block_nesting;
|
||||
|
||||
/**
|
||||
* Create parse tree buffer for Smarty tag
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data content
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
$this->saved_block_nesting = $parser->block_nesting_level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content
|
||||
*
|
||||
* @return string content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return complied code that loads the evaluated outout of buffer content into a temporary variable
|
||||
*
|
||||
* @return string template code
|
||||
*/
|
||||
public function assign_to_var()
|
||||
{
|
||||
$var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number);
|
||||
$this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Code fragment inside a tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_code extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer for code fragment
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data content
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content in parentheses
|
||||
*
|
||||
* @return string content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return sprintf("(%s)", $this->data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Double quoted string inside a tag.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_doublequoted extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer for double quoted string subtrees
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param _smarty_parsetree $subtree parsetree buffer
|
||||
*/
|
||||
public function __construct($parser, _smarty_parsetree $subtree)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->subtrees[] = $subtree;
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Append buffer to subtree
|
||||
*
|
||||
* @param _smarty_parsetree $subtree parsetree buffer
|
||||
*/
|
||||
public function append_subtree(_smarty_parsetree $subtree)
|
||||
{
|
||||
$last_subtree = count($this->subtrees) - 1;
|
||||
if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
|
||||
if ($subtree instanceof _smarty_code) {
|
||||
$this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
|
||||
} elseif ($subtree instanceof _smarty_dq_content) {
|
||||
$this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
|
||||
} else {
|
||||
$this->subtrees[$last_subtree]->data .= $subtree->data;
|
||||
}
|
||||
} else {
|
||||
$this->subtrees[] = $subtree;
|
||||
}
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge subtree buffer content together
|
||||
*
|
||||
* @return string compiled template code
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
$code = '';
|
||||
foreach ($this->subtrees as $subtree) {
|
||||
if ($code !== "") {
|
||||
$code .= ".";
|
||||
}
|
||||
if ($subtree instanceof _smarty_tag) {
|
||||
$more_php = $subtree->assign_to_var();
|
||||
} else {
|
||||
$more_php = $subtree->to_smarty_php();
|
||||
}
|
||||
|
||||
$code .= $more_php;
|
||||
|
||||
if (!$subtree instanceof _smarty_dq_content) {
|
||||
$this->parser->compiler->has_variable_string = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw chars as part of a double quoted string.
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_dq_content extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create parse tree buffer with string content
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data string section
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return content as double quoted string
|
||||
*
|
||||
* @return string doubled quoted string
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return '"' . $this->data . '"';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Template element
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_template_buffer extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Array of template elements
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $subtrees = Array();
|
||||
|
||||
/**
|
||||
* Create root of parse tree for template elements
|
||||
*
|
||||
* @param object $parser parse object
|
||||
*/
|
||||
public function __construct($parser)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append buffer to subtree
|
||||
*
|
||||
* @param _smarty_parsetree $subtree
|
||||
*/
|
||||
public function append_subtree(_smarty_parsetree $subtree)
|
||||
{
|
||||
$this->subtrees[] = $subtree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize and merge subtree buffers together
|
||||
*
|
||||
* @return string template code content
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
$code = '';
|
||||
for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
|
||||
if ($key + 2 < $cnt) {
|
||||
if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
|
||||
$key = $key + 1;
|
||||
continue;
|
||||
}
|
||||
if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
|
||||
$key = $key + 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (substr($code, -1) == '<') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '?') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
|
||||
} elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ($this->parser->asp_tags && substr($code, -1) == '%') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '>') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (substr($code, -1) == '?') {
|
||||
$subtree = $this->subtrees[$key]->to_smarty_php();
|
||||
if (substr($subtree, 0, 1) == '>') {
|
||||
$code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
|
||||
} else {
|
||||
$code .= $subtree;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$code .= $this->subtrees[$key]->to_smarty_php();
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* template text
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_text extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create template text buffer
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data text
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return buffer content
|
||||
*
|
||||
* @return strint text
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* template linebreaks
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @ignore
|
||||
*/
|
||||
class _smarty_linebreak extends _smarty_parsetree
|
||||
{
|
||||
/**
|
||||
* Create buffer with linebreak content
|
||||
*
|
||||
* @param object $parser parser object
|
||||
* @param string $data linebreak string
|
||||
*/
|
||||
public function __construct($parser, $data)
|
||||
{
|
||||
$this->parser = $parser;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return linebrak
|
||||
*
|
||||
* @return string linebreak
|
||||
*/
|
||||
public function to_smarty_php()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Smarty Internal Plugin Templatelexer
|
||||
*
|
||||
* This is the lexer to break the template source into tokens
|
||||
* This is the lexer to break the template source into tokens
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Uwe Tews
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
/**
|
||||
* Smarty Internal Plugin Templatelexer
|
||||
@@ -22,58 +22,59 @@ class Smarty_Internal_Templatelexer
|
||||
public $state = 1;
|
||||
private $heredoc_id_stack = Array();
|
||||
public $smarty_token_names = array ( // Text for parser error messages
|
||||
'IDENTITY' => '===',
|
||||
'NONEIDENTITY' => '!==',
|
||||
'EQUALS' => '==',
|
||||
'NOTEQUALS' => '!=',
|
||||
'GREATEREQUAL' => '(>=,ge)',
|
||||
'LESSEQUAL' => '(<=,le)',
|
||||
'GREATERTHAN' => '(>,gt)',
|
||||
'LESSTHAN' => '(<,lt)',
|
||||
'MOD' => '(%,mod)',
|
||||
'NOT' => '(!,not)',
|
||||
'LAND' => '(&&,and)',
|
||||
'LOR' => '(||,or)',
|
||||
'LXOR' => 'xor',
|
||||
'OPENP' => '(',
|
||||
'CLOSEP' => ')',
|
||||
'OPENB' => '[',
|
||||
'CLOSEB' => ']',
|
||||
'PTR' => '->',
|
||||
'APTR' => '=>',
|
||||
'EQUAL' => '=',
|
||||
'NUMBER' => 'number',
|
||||
'UNIMATH' => '+" , "-',
|
||||
'MATH' => '*" , "/" , "%',
|
||||
'INCDEC' => '++" , "--',
|
||||
'SPACE' => ' ',
|
||||
'DOLLAR' => '$',
|
||||
'SEMICOLON' => ';',
|
||||
'COLON' => ':',
|
||||
'DOUBLECOLON' => '::',
|
||||
'AT' => '@',
|
||||
'HATCH' => '#',
|
||||
'QUOTE' => '"',
|
||||
'BACKTICK' => '`',
|
||||
'VERT' => '|',
|
||||
'DOT' => '.',
|
||||
'COMMA' => '","',
|
||||
'ANDSYM' => '"&"',
|
||||
'QMARK' => '"?"',
|
||||
'ID' => 'identifier',
|
||||
'TEXT' => 'text',
|
||||
'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
|
||||
'PHPSTARTTAG' => 'PHP start tag',
|
||||
'PHPENDTAG' => 'PHP end tag',
|
||||
'LITERALSTART' => 'Literal start',
|
||||
'LITERALEND' => 'Literal end',
|
||||
'LDELSLASH' => 'closing tag',
|
||||
'COMMENT' => 'comment',
|
||||
'AS' => 'as',
|
||||
'TO' => 'to',
|
||||
);
|
||||
|
||||
public function __construct($data,$compiler)
|
||||
'IDENTITY' => '===',
|
||||
'NONEIDENTITY' => '!==',
|
||||
'EQUALS' => '==',
|
||||
'NOTEQUALS' => '!=',
|
||||
'GREATEREQUAL' => '(>=,ge)',
|
||||
'LESSEQUAL' => '(<=,le)',
|
||||
'GREATERTHAN' => '(>,gt)',
|
||||
'LESSTHAN' => '(<,lt)',
|
||||
'MOD' => '(%,mod)',
|
||||
'NOT' => '(!,not)',
|
||||
'LAND' => '(&&,and)',
|
||||
'LOR' => '(||,or)',
|
||||
'LXOR' => 'xor',
|
||||
'OPENP' => '(',
|
||||
'CLOSEP' => ')',
|
||||
'OPENB' => '[',
|
||||
'CLOSEB' => ']',
|
||||
'PTR' => '->',
|
||||
'APTR' => '=>',
|
||||
'EQUAL' => '=',
|
||||
'NUMBER' => 'number',
|
||||
'UNIMATH' => '+" , "-',
|
||||
'MATH' => '*" , "/" , "%',
|
||||
'INCDEC' => '++" , "--',
|
||||
'SPACE' => ' ',
|
||||
'DOLLAR' => '$',
|
||||
'SEMICOLON' => ';',
|
||||
'COLON' => ':',
|
||||
'DOUBLECOLON' => '::',
|
||||
'AT' => '@',
|
||||
'HATCH' => '#',
|
||||
'QUOTE' => '"',
|
||||
'BACKTICK' => '`',
|
||||
'VERT' => '|',
|
||||
'DOT' => '.',
|
||||
'COMMA' => '","',
|
||||
'ANDSYM' => '"&"',
|
||||
'QMARK' => '"?"',
|
||||
'ID' => 'identifier',
|
||||
'TEXT' => 'text',
|
||||
'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
|
||||
'PHPSTARTTAG' => 'PHP start tag',
|
||||
'PHPENDTAG' => 'PHP end tag',
|
||||
'LITERALSTART' => 'Literal start',
|
||||
'LITERALEND' => 'Literal end',
|
||||
'LDELSLASH' => 'closing tag',
|
||||
'COMMENT' => 'comment',
|
||||
'AS' => 'as',
|
||||
'TO' => 'to',
|
||||
);
|
||||
|
||||
|
||||
function __construct($data,$compiler)
|
||||
{
|
||||
// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
|
||||
$this->data = $data;
|
||||
@@ -81,15 +82,16 @@ class Smarty_Internal_Templatelexer
|
||||
$this->line = 1;
|
||||
$this->smarty = $compiler->smarty;
|
||||
$this->compiler = $compiler;
|
||||
$this->ldel = preg_quote($this->smarty->left_delimiter,'/');
|
||||
$this->ldel_length = strlen($this->smarty->left_delimiter);
|
||||
$this->ldel = preg_quote($this->smarty->left_delimiter,'/');
|
||||
$this->ldel_length = strlen($this->smarty->left_delimiter);
|
||||
$this->rdel = preg_quote($this->smarty->right_delimiter,'/');
|
||||
$this->rdel_length = strlen($this->smarty->right_delimiter);
|
||||
$this->rdel_length = strlen($this->smarty->right_delimiter);
|
||||
$this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
|
||||
$this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
|
||||
$this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
|
||||
}
|
||||
|
||||
|
||||
private $_yy_state = 1;
|
||||
private $_yy_stack = array();
|
||||
|
||||
@@ -114,6 +116,8 @@ class Smarty_Internal_Templatelexer
|
||||
$this->_yy_state = $state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function yylex1()
|
||||
{
|
||||
$tokenMap = array (
|
||||
@@ -191,28 +195,29 @@ class Smarty_Internal_Templatelexer
|
||||
|
||||
} // end function
|
||||
|
||||
|
||||
const TEXT = 1;
|
||||
public function yy_r1_1($yy_subpatterns)
|
||||
function yy_r1_1($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD;
|
||||
}
|
||||
public function yy_r1_2($yy_subpatterns)
|
||||
function yy_r1_2($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
public function yy_r1_3($yy_subpatterns)
|
||||
function yy_r1_3($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_COMMENT;
|
||||
}
|
||||
public function yy_r1_5($yy_subpatterns)
|
||||
function yy_r1_5($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_STRIPON;
|
||||
}
|
||||
public function yy_r1_6($yy_subpatterns)
|
||||
function yy_r1_6($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -221,12 +226,12 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_STRIPON;
|
||||
}
|
||||
}
|
||||
public function yy_r1_7($yy_subpatterns)
|
||||
function yy_r1_7($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
|
||||
}
|
||||
public function yy_r1_8($yy_subpatterns)
|
||||
function yy_r1_8($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -235,13 +240,13 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
|
||||
}
|
||||
}
|
||||
public function yy_r1_9($yy_subpatterns)
|
||||
function yy_r1_9($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
|
||||
$this->yypushstate(self::LITERAL);
|
||||
}
|
||||
public function yy_r1_10($yy_subpatterns)
|
||||
function yy_r1_10($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -252,7 +257,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_11($yy_subpatterns)
|
||||
function yy_r1_11($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -263,7 +268,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_13($yy_subpatterns)
|
||||
function yy_r1_13($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -274,7 +279,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_14($yy_subpatterns)
|
||||
function yy_r1_14($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -285,7 +290,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_15($yy_subpatterns)
|
||||
function yy_r1_15($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -296,7 +301,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_16($yy_subpatterns)
|
||||
function yy_r1_16($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -307,21 +312,21 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r1_17($yy_subpatterns)
|
||||
function yy_r1_17($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r1_18($yy_subpatterns)
|
||||
function yy_r1_18($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r1_19($yy_subpatterns)
|
||||
function yy_r1_19($yy_subpatterns)
|
||||
{
|
||||
|
||||
if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
|
||||
@@ -333,27 +338,27 @@ class Smarty_Internal_Templatelexer
|
||||
$this->value = substr($this->value, 0, 2);
|
||||
}
|
||||
}
|
||||
public function yy_r1_20($yy_subpatterns)
|
||||
function yy_r1_20($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
|
||||
}
|
||||
public function yy_r1_21($yy_subpatterns)
|
||||
function yy_r1_21($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
public function yy_r1_22($yy_subpatterns)
|
||||
function yy_r1_22($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
|
||||
}
|
||||
public function yy_r1_23($yy_subpatterns)
|
||||
function yy_r1_23($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
|
||||
}
|
||||
public function yy_r1_24($yy_subpatterns)
|
||||
function yy_r1_24($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->mbstring_overload) {
|
||||
@@ -373,6 +378,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
|
||||
|
||||
public function yylex2()
|
||||
{
|
||||
$tokenMap = array (
|
||||
@@ -496,13 +502,14 @@ class Smarty_Internal_Templatelexer
|
||||
|
||||
} // end function
|
||||
|
||||
|
||||
const SMARTY = 2;
|
||||
public function yy_r2_1($yy_subpatterns)
|
||||
function yy_r2_1($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
|
||||
}
|
||||
public function yy_r2_2($yy_subpatterns)
|
||||
function yy_r2_2($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -513,7 +520,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r2_3($yy_subpatterns)
|
||||
function yy_r2_3($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -524,7 +531,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r2_5($yy_subpatterns)
|
||||
function yy_r2_5($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -535,7 +542,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r2_6($yy_subpatterns)
|
||||
function yy_r2_6($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -546,7 +553,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r2_7($yy_subpatterns)
|
||||
function yy_r2_7($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -557,300 +564,300 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r2_8($yy_subpatterns)
|
||||
function yy_r2_8($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
|
||||
$this->yypopstate();
|
||||
}
|
||||
public function yy_r2_9($yy_subpatterns)
|
||||
function yy_r2_9($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r2_10($yy_subpatterns)
|
||||
function yy_r2_10($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r2_11($yy_subpatterns)
|
||||
function yy_r2_11($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
|
||||
$this->yypopstate();
|
||||
}
|
||||
public function yy_r2_12($yy_subpatterns)
|
||||
function yy_r2_12($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISIN;
|
||||
}
|
||||
public function yy_r2_13($yy_subpatterns)
|
||||
function yy_r2_13($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_AS;
|
||||
}
|
||||
public function yy_r2_14($yy_subpatterns)
|
||||
function yy_r2_14($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TO;
|
||||
}
|
||||
public function yy_r2_15($yy_subpatterns)
|
||||
function yy_r2_15($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_STEP;
|
||||
}
|
||||
public function yy_r2_16($yy_subpatterns)
|
||||
function yy_r2_16($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
|
||||
}
|
||||
public function yy_r2_17($yy_subpatterns)
|
||||
function yy_r2_17($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
|
||||
}
|
||||
public function yy_r2_18($yy_subpatterns)
|
||||
function yy_r2_18($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
|
||||
}
|
||||
public function yy_r2_19($yy_subpatterns)
|
||||
function yy_r2_19($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_EQUALS;
|
||||
}
|
||||
public function yy_r2_20($yy_subpatterns)
|
||||
function yy_r2_20($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
|
||||
}
|
||||
public function yy_r2_22($yy_subpatterns)
|
||||
function yy_r2_22($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
|
||||
}
|
||||
public function yy_r2_24($yy_subpatterns)
|
||||
function yy_r2_24($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
|
||||
}
|
||||
public function yy_r2_26($yy_subpatterns)
|
||||
function yy_r2_26($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
|
||||
}
|
||||
public function yy_r2_27($yy_subpatterns)
|
||||
function yy_r2_27($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
|
||||
}
|
||||
public function yy_r2_28($yy_subpatterns)
|
||||
function yy_r2_28($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_MOD;
|
||||
}
|
||||
public function yy_r2_29($yy_subpatterns)
|
||||
function yy_r2_29($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_NOT;
|
||||
}
|
||||
public function yy_r2_30($yy_subpatterns)
|
||||
function yy_r2_30($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LAND;
|
||||
}
|
||||
public function yy_r2_31($yy_subpatterns)
|
||||
function yy_r2_31($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LOR;
|
||||
}
|
||||
public function yy_r2_32($yy_subpatterns)
|
||||
function yy_r2_32($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LXOR;
|
||||
}
|
||||
public function yy_r2_33($yy_subpatterns)
|
||||
function yy_r2_33($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
|
||||
}
|
||||
public function yy_r2_34($yy_subpatterns)
|
||||
function yy_r2_34($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
|
||||
}
|
||||
public function yy_r2_35($yy_subpatterns)
|
||||
function yy_r2_35($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISODD;
|
||||
}
|
||||
public function yy_r2_36($yy_subpatterns)
|
||||
function yy_r2_36($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
|
||||
}
|
||||
public function yy_r2_37($yy_subpatterns)
|
||||
function yy_r2_37($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
|
||||
}
|
||||
public function yy_r2_38($yy_subpatterns)
|
||||
function yy_r2_38($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
|
||||
}
|
||||
public function yy_r2_39($yy_subpatterns)
|
||||
function yy_r2_39($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
|
||||
}
|
||||
public function yy_r2_40($yy_subpatterns)
|
||||
function yy_r2_40($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
|
||||
}
|
||||
public function yy_r2_41($yy_subpatterns)
|
||||
function yy_r2_41($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
|
||||
}
|
||||
public function yy_r2_42($yy_subpatterns)
|
||||
function yy_r2_42($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
|
||||
}
|
||||
public function yy_r2_43($yy_subpatterns)
|
||||
function yy_r2_43($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
|
||||
}
|
||||
public function yy_r2_47($yy_subpatterns)
|
||||
function yy_r2_47($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_OPENP;
|
||||
}
|
||||
public function yy_r2_48($yy_subpatterns)
|
||||
function yy_r2_48($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
|
||||
}
|
||||
public function yy_r2_49($yy_subpatterns)
|
||||
function yy_r2_49($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_OPENB;
|
||||
}
|
||||
public function yy_r2_50($yy_subpatterns)
|
||||
function yy_r2_50($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
|
||||
}
|
||||
public function yy_r2_51($yy_subpatterns)
|
||||
function yy_r2_51($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PTR;
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PTR;
|
||||
}
|
||||
public function yy_r2_52($yy_subpatterns)
|
||||
function yy_r2_52($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_APTR;
|
||||
}
|
||||
public function yy_r2_53($yy_subpatterns)
|
||||
function yy_r2_53($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_EQUAL;
|
||||
}
|
||||
public function yy_r2_54($yy_subpatterns)
|
||||
function yy_r2_54($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_INCDEC;
|
||||
}
|
||||
public function yy_r2_55($yy_subpatterns)
|
||||
function yy_r2_55($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
|
||||
}
|
||||
public function yy_r2_57($yy_subpatterns)
|
||||
function yy_r2_57($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_MATH;
|
||||
}
|
||||
public function yy_r2_59($yy_subpatterns)
|
||||
function yy_r2_59($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
|
||||
}
|
||||
public function yy_r2_60($yy_subpatterns)
|
||||
function yy_r2_60($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
|
||||
}
|
||||
public function yy_r2_61($yy_subpatterns)
|
||||
function yy_r2_61($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
|
||||
}
|
||||
public function yy_r2_62($yy_subpatterns)
|
||||
function yy_r2_62($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_COLON;
|
||||
}
|
||||
public function yy_r2_63($yy_subpatterns)
|
||||
function yy_r2_63($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_AT;
|
||||
}
|
||||
public function yy_r2_64($yy_subpatterns)
|
||||
function yy_r2_64($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_HATCH;
|
||||
}
|
||||
public function yy_r2_65($yy_subpatterns)
|
||||
function yy_r2_65($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
|
||||
$this->yypushstate(self::DOUBLEQUOTEDSTRING);
|
||||
}
|
||||
public function yy_r2_66($yy_subpatterns)
|
||||
function yy_r2_66($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
|
||||
$this->yypopstate();
|
||||
}
|
||||
public function yy_r2_67($yy_subpatterns)
|
||||
function yy_r2_67($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_VERT;
|
||||
}
|
||||
public function yy_r2_68($yy_subpatterns)
|
||||
function yy_r2_68($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_DOT;
|
||||
}
|
||||
public function yy_r2_69($yy_subpatterns)
|
||||
function yy_r2_69($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_COMMA;
|
||||
}
|
||||
public function yy_r2_70($yy_subpatterns)
|
||||
function yy_r2_70($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
|
||||
}
|
||||
public function yy_r2_71($yy_subpatterns)
|
||||
function yy_r2_71($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_QMARK;
|
||||
}
|
||||
public function yy_r2_72($yy_subpatterns)
|
||||
function yy_r2_72($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_HEX;
|
||||
}
|
||||
public function yy_r2_73($yy_subpatterns)
|
||||
function yy_r2_73($yy_subpatterns)
|
||||
{
|
||||
|
||||
// resolve conflicts with shorttag and right_delimiter starting with '='
|
||||
@@ -862,27 +869,29 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ATTR;
|
||||
}
|
||||
}
|
||||
public function yy_r2_74($yy_subpatterns)
|
||||
function yy_r2_74($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ID;
|
||||
}
|
||||
public function yy_r2_75($yy_subpatterns)
|
||||
function yy_r2_75($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_INTEGER;
|
||||
}
|
||||
public function yy_r2_76($yy_subpatterns)
|
||||
function yy_r2_76($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_SPACE;
|
||||
}
|
||||
public function yy_r2_77($yy_subpatterns)
|
||||
function yy_r2_77($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function yylex3()
|
||||
{
|
||||
$tokenMap = array (
|
||||
@@ -945,20 +954,21 @@ class Smarty_Internal_Templatelexer
|
||||
|
||||
} // end function
|
||||
|
||||
|
||||
const LITERAL = 3;
|
||||
public function yy_r3_1($yy_subpatterns)
|
||||
function yy_r3_1($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
|
||||
$this->yypushstate(self::LITERAL);
|
||||
}
|
||||
public function yy_r3_2($yy_subpatterns)
|
||||
function yy_r3_2($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
|
||||
$this->yypopstate();
|
||||
}
|
||||
public function yy_r3_3($yy_subpatterns)
|
||||
function yy_r3_3($yy_subpatterns)
|
||||
{
|
||||
|
||||
if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
|
||||
@@ -968,22 +978,22 @@ class Smarty_Internal_Templatelexer
|
||||
$this->value = substr($this->value, 0, 2);
|
||||
}
|
||||
}
|
||||
public function yy_r3_4($yy_subpatterns)
|
||||
function yy_r3_4($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
|
||||
}
|
||||
public function yy_r3_5($yy_subpatterns)
|
||||
function yy_r3_5($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
|
||||
}
|
||||
public function yy_r3_6($yy_subpatterns)
|
||||
function yy_r3_6($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
|
||||
}
|
||||
public function yy_r3_7($yy_subpatterns)
|
||||
function yy_r3_7($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->mbstring_overload) {
|
||||
@@ -996,7 +1006,7 @@ class Smarty_Internal_Templatelexer
|
||||
$to = $match[0][1];
|
||||
} else {
|
||||
$this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
|
||||
}
|
||||
}
|
||||
if ($this->mbstring_overload) {
|
||||
$this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1');
|
||||
} else {
|
||||
@@ -1005,6 +1015,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
|
||||
}
|
||||
|
||||
|
||||
public function yylex4()
|
||||
{
|
||||
$tokenMap = array (
|
||||
@@ -1073,8 +1084,9 @@ class Smarty_Internal_Templatelexer
|
||||
|
||||
} // end function
|
||||
|
||||
|
||||
const DOUBLEQUOTEDSTRING = 4;
|
||||
public function yy_r4_1($yy_subpatterns)
|
||||
function yy_r4_1($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -1085,7 +1097,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r4_2($yy_subpatterns)
|
||||
function yy_r4_2($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -1096,7 +1108,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r4_4($yy_subpatterns)
|
||||
function yy_r4_4($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -1107,7 +1119,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r4_5($yy_subpatterns)
|
||||
function yy_r4_5($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
|
||||
@@ -1118,7 +1130,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r4_6($yy_subpatterns)
|
||||
function yy_r4_6($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -1129,27 +1141,27 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
public function yy_r4_7($yy_subpatterns)
|
||||
function yy_r4_7($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r4_8($yy_subpatterns)
|
||||
function yy_r4_8($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r4_9($yy_subpatterns)
|
||||
function yy_r4_9($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
|
||||
$this->yypopstate();
|
||||
}
|
||||
public function yy_r4_10($yy_subpatterns)
|
||||
function yy_r4_10($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
|
||||
@@ -1157,22 +1169,22 @@ class Smarty_Internal_Templatelexer
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
public function yy_r4_11($yy_subpatterns)
|
||||
function yy_r4_11($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
|
||||
}
|
||||
public function yy_r4_12($yy_subpatterns)
|
||||
function yy_r4_12($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
public function yy_r4_13($yy_subpatterns)
|
||||
function yy_r4_13($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
|
||||
}
|
||||
public function yy_r4_17($yy_subpatterns)
|
||||
function yy_r4_17($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->mbstring_overload) {
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user