diff --git a/lexer/smarty_internal_templateparser.y b/lexer/smarty_internal_templateparser.y index ba023b34..a3194ac8 100644 --- a/lexer/smarty_internal_templateparser.y +++ b/lexer/smarty_internal_templateparser.y @@ -65,13 +65,13 @@ class Smarty_Internal_Templateparser /** * root parse tree buffer * - * @var _smarty_template_buffer + * @var Smarty_Internal_ParseTree */ public $root_buffer; /** * current parse tree object * - * @var _smarty_template_buffer + * @var Smarty_Internal_ParseTree */ public $current_buffer; /** @@ -161,7 +161,7 @@ class Smarty_Internal_Templateparser $this->php_handling = $this->smarty->php_handling; } $this->asp_tags = (ini_get('asp_tags') != '0'); - $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); + $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template($this); } /** @@ -171,7 +171,7 @@ class Smarty_Internal_Templateparser */ public function insertPhpCode($code) { - $this->current_buffer->append_subtree(new _smarty_tag($this, $code)); + $this->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($this, $code)); } /** @@ -191,7 +191,7 @@ class Smarty_Internal_Templateparser } return '$_smarty_tpl->tpl_vars[' . $variable . ']->value'; } -} +} %token_prefix TP_ @@ -200,8 +200,6 @@ class Smarty_Internal_Templateparser $this->successful = !$this->internalError; $this->internalError = false; $this->retvalue = $this->_retvalue; - //echo $this->retvalue."\n\n"; - } %syntax_error @@ -220,16 +218,16 @@ class Smarty_Internal_Templateparser %left VERT. %left COLON. -// -// complete template -// + // + // complete template + // start(res) ::= template. { res = $this->root_buffer->to_smarty_php(); } -// -// loop over template elements -// + // + // loop over template elements + // // single template element template ::= template_element(e). { if (e != null) { @@ -255,7 +253,7 @@ template ::= . template_element(res)::= smartytag(st) RDEL. { if ($this->compiler->has_code) { $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); - res = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.st,true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp.st,true)); } else { res = null; } @@ -270,7 +268,7 @@ template_element(res)::= COMMENT(c). { // Literal template_element(res) ::= literal(l). { - res = new _smarty_text($this, l); + res = new Smarty_Internal_ParseTree_Text($this, l); } // '' tag @@ -281,17 +279,17 @@ template_element(res)::= PHPSTARTTAG(st). { if ($this->php_handling == Smarty::PHP_PASSTHRU) { if ($this->lex->is_phpScript) { $s = addcslashes(st, "'"); - res = new _smarty_text($this, $s); + res = new Smarty_Internal_ParseTree_Text($this, $s); } else { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - res = new _smarty_text($this, htmlspecialchars(st, ENT_QUOTES)); + res = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars(st, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if (!($this->smarty instanceof SmartyBC)) { $this->compiler->trigger_template_error (self::Err3); } - res = new _smarty_tag($this, $this->compiler->processNocacheCode('compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) { res = null; } @@ -303,14 +301,14 @@ template_element(res)::= PHPENDTAG(st). { $this->compiler->tag_nocache = true; $this->is_xml = false; $save = $this->template->has_nocache_code; - res = new _smarty_tag($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); $this->template->has_nocache_code = $save; } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - res = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); + res = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars('?>', ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - res = new _smarty_tag($this, $this->compiler->processNocacheCode('?>', true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('?>', true)); } elseif ($this->php_handling == Smarty::PHP_REMOVE) { res = null; } @@ -318,15 +316,15 @@ template_element(res)::= PHPENDTAG(st). { // '' tag (only for PHP) template_element(res)::= PHPENDSCRIPT(st). { if (!$this->lex->is_phpScript) { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } else { $this->lex->is_phpScript = false; if ($this->php_handling == Smarty::PHP_PASSTHRU) { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - res = new _smarty_text($this, htmlspecialchars(st, ENT_QUOTES)); + res = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars(st, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - res = new _smarty_tag($this, $this->compiler->processNocacheCode('?>', true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('?>', true)); } elseif ($this->php_handling == Smarty::PHP_REMOVE) { res = null; } @@ -336,23 +334,23 @@ template_element(res)::= PHPENDSCRIPT(st). { // '<%' tag template_element(res)::= ASPSTARTTAG(st). { if ($this->php_handling == Smarty::PHP_PASSTHRU) { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - res = new _smarty_text($this, htmlspecialchars(st, ENT_QUOTES)); + res = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars(st, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if ($this->asp_tags) { if (!($this->smarty instanceof SmartyBC)) { $this->compiler->trigger_template_error (self::Err3); } - res = new _smarty_tag($this, $this->compiler->processNocacheCode('<%', true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('<%', true)); } else { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } } elseif ($this->php_handling == Smarty::PHP_REMOVE) { if ($this->asp_tags) { res = null; } else { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } } } @@ -360,20 +358,20 @@ template_element(res)::= ASPSTARTTAG(st). { // '%>' tag template_element(res)::= ASPENDTAG(st). { if ($this->php_handling == Smarty::PHP_PASSTHRU) { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - res = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); + res = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars('%>', ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if ($this->asp_tags) { - res = new _smarty_tag($this, $this->compiler->processNocacheCode('%>', true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('%>', true)); } else { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } } elseif ($this->php_handling == Smarty::PHP_REMOVE) { if ($this->asp_tags) { res = null; } else { - res = new _smarty_text($this, st); + res = new Smarty_Internal_ParseTree_Text($this, st); } } } @@ -384,16 +382,16 @@ template_element(res)::= XMLTAG. { $this->compiler->tag_nocache = true; $this->is_xml = true; $save = $this->template->has_nocache_code; - res = new _smarty_tag($this, $this->compiler->processNocacheCode("", $this->compiler, true)); + res = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("", $this->compiler, true)); $this->template->has_nocache_code = $save; } // template text template_element(res)::= TEXT(o). { if ($this->strip) { - res = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', o)); + res = new Smarty_Internal_ParseTree_Text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', o)); } else { - res = new _smarty_text($this, o); + res = new Smarty_Internal_ParseTree_Text($this, o); } } @@ -648,12 +646,8 @@ attributes(res) ::= . { // attribute attribute(res) ::= SPACE ID(v) EQUAL ID(id). { - if (preg_match('~^true$~i', id)) { - res = array(v=>'true'); - } elseif (preg_match('~^false$~i', id)) { - res = array(v=>'false'); - } elseif (preg_match('~^null$~i', id)) { - res = array(v=>'null'); + if (defined(id)) { + res = array(v=>id); } else { res = array(v=>"'".id."'"); } @@ -812,9 +806,6 @@ expr(res) ::= expr(e1) ISNOTODDBY expr(e2). { } expr(res) ::= variable(v1) INSTANCEOF(i) ns1(v2). { -// self::$prefix_number++; -// $this->compiler->prefix_code[] = ''; - // res = '$_tmp'.self::$prefix_number.i.v2; res = v1.i.v2; } @@ -940,7 +931,7 @@ value(res) ::= ns1(c)DOUBLECOLON static_class_access(s). { res = c.'::'.s; } } else { - $this->compiler->error ("static class '".c."' is undefined or not allowed by security setting"); + $this->compiler->trigger_template_error ("static class '".c."' is undefined or not allowed by security setting"); } } // @@ -1063,7 +1054,7 @@ indexdef(res) ::= OPENB expr(e) CLOSEB. { res = "[". e ."]"; } - // f�r assign append array + // for assign append array indexdef(res) ::= OPENB CLOSEB. { res = '[]'; } @@ -1388,35 +1379,35 @@ doublequoted(res) ::= doublequoted(o1) doublequotedcontent(o2). { } doublequoted(res) ::= doublequotedcontent(o). { - res = new _smarty_doublequoted($this, o); + res = new Smarty_Internal_ParseTree_Dq($this, o); } doublequotedcontent(res) ::= BACKTICK variable(v) BACKTICK. { - res = new _smarty_code($this, '(string)'.v); + res = new Smarty_Internal_ParseTree_Code($this, '(string)'.v); } doublequotedcontent(res) ::= BACKTICK expr(e) BACKTICK. { - res = new _smarty_code($this, '(string)'.e); + res = new Smarty_Internal_ParseTree_Code($this, '(string)'.e); } doublequotedcontent(res) ::= DOLLARID(i). { - res = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr(i,1) .'\']->value'); + res = new Smarty_Internal_ParseTree_Code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr(i,1) .'\']->value'); } doublequotedcontent(res) ::= LDEL variable(v) RDEL. { - res = new _smarty_code($this, '(string)'.v); + res = new Smarty_Internal_ParseTree_Code($this, '(string)'.v); } doublequotedcontent(res) ::= LDEL expr(e) RDEL. { - res = new _smarty_code($this, '(string)('.e.')'); + res = new Smarty_Internal_ParseTree_Code($this, '(string)('.e.')'); } doublequotedcontent(res) ::= smartytag(st) RDEL. { - res = new _smarty_tag($this, st); + res = new Smarty_Internal_ParseTree_Tag($this, st); } doublequotedcontent(res) ::= TEXT(o). { - res = new _smarty_dq_content($this, o); + res = new Smarty_Internal_ParseTree_DqContent($this, o); } diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index f154d7ea..c06c7cf3 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -132,13 +132,13 @@ class Smarty_Internal_Templateparser /** * root parse tree buffer * - * @var _smarty_template_buffer + * @var Smarty_Internal_ParseTree */ public $root_buffer; /** * current parse tree object * - * @var _smarty_template_buffer + * @var Smarty_Internal_ParseTree */ public $current_buffer; /** @@ -228,7 +228,7 @@ class Smarty_Internal_Templateparser $this->php_handling = $this->smarty->php_handling; } $this->asp_tags = (ini_get('asp_tags') != '0'); - $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); + $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template($this); } /** @@ -238,7 +238,7 @@ class Smarty_Internal_Templateparser */ public function insertPhpCode($code) { - $this->current_buffer->append_subtree(new _smarty_tag($this, $code)); + $this->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($this, $code)); } /** @@ -1840,7 +1840,7 @@ class Smarty_Internal_Templateparser while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - #line 215 "../smarty/lexer/smarty_internal_templateparser.y" + #line 213 "../smarty/lexer/smarty_internal_templateparser.y" $this->internalError = true; $this->compiler->trigger_template_error("Stack overflow in template parser"); @@ -2275,13 +2275,13 @@ class Smarty_Internal_Templateparser 200 => 200, ); - #line 226 "../smarty/lexer/smarty_internal_templateparser.y" + #line 224 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r0() { $this->_retvalue = $this->root_buffer->to_smarty_php(); } - #line 234 "../smarty/lexer/smarty_internal_templateparser.y" + #line 232 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r1() { if ($this->yystack[$this->yyidx + 0]->minor != null) { @@ -2289,7 +2289,7 @@ class Smarty_Internal_Templateparser } } - #line 241 "../smarty/lexer/smarty_internal_templateparser.y" + #line 239 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r2() { if ($this->yystack[$this->yyidx + 0]->minor != null) { @@ -2298,7 +2298,7 @@ class Smarty_Internal_Templateparser } } - #line 255 "../smarty/lexer/smarty_internal_templateparser.y" + #line 253 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r4() { if ($this->compiler->has_code) { @@ -2307,7 +2307,7 @@ class Smarty_Internal_Templateparser $tmp .= $code; } $this->compiler->prefix_code = array(); - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp . $this->yystack[$this->yyidx + - 1]->minor, true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $this->yystack[$this->yyidx + - 1]->minor, true)); } else { $this->_retvalue = null; } @@ -2315,19 +2315,19 @@ class Smarty_Internal_Templateparser $this->block_nesting_level = count($this->compiler->_tag_stack); } - #line 267 "../smarty/lexer/smarty_internal_templateparser.y" + #line 265 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r5() { $this->_retvalue = null; } - #line 272 "../smarty/lexer/smarty_internal_templateparser.y" + #line 270 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r6() { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } - #line 277 "../smarty/lexer/smarty_internal_templateparser.y" + #line 275 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r7() { if (strpos($this->yystack[$this->yyidx + 0]->minor, 'php_handling == Smarty::PHP_PASSTHRU) { if ($this->lex->is_phpScript) { $s = addcslashes($this->yystack[$this->yyidx + 0]->minor, "'"); - $this->_retvalue = new _smarty_text($this, $s); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $s); } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if (!($this->smarty instanceof SmartyBC)) { $this->compiler->trigger_template_error(self::Err3); } - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode('_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) { $this->_retvalue = null; } } - #line 301 "../smarty/lexer/smarty_internal_templateparser.y" + #line 299 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r8() { if ($this->is_xml) { $this->compiler->tag_nocache = true; $this->is_xml = false; $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); $this->template->has_nocache_code = $save; } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars('?>', ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode('?>', true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('?>', true)); } elseif ($this->php_handling == Smarty::PHP_REMOVE) { $this->_retvalue = null; } } - #line 319 "../smarty/lexer/smarty_internal_templateparser.y" + #line 317 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r9() { if (!$this->lex->is_phpScript) { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } else { $this->lex->is_phpScript = false; if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode('?>', true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('?>', true)); } elseif ($this->php_handling == Smarty::PHP_REMOVE) { $this->_retvalue = null; } } } - #line 337 "../smarty/lexer/smarty_internal_templateparser.y" + #line 335 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r10() { if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if ($this->asp_tags) { if (!($this->smarty instanceof SmartyBC)) { $this->compiler->trigger_template_error(self::Err3); } - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode('<%', true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('<%', true)); } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } elseif ($this->php_handling == Smarty::PHP_REMOVE) { if ($this->asp_tags) { $this->_retvalue = null; } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } } - #line 361 "../smarty/lexer/smarty_internal_templateparser.y" + #line 359 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r11() { if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, htmlspecialchars('%>', ENT_QUOTES)); } elseif ($this->php_handling == Smarty::PHP_ALLOW) { if ($this->asp_tags) { - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode('%>', true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode('%>', true)); } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } elseif ($this->php_handling == Smarty::PHP_REMOVE) { if ($this->asp_tags) { $this->_retvalue = null; } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } } - #line 383 "../smarty/lexer/smarty_internal_templateparser.y" + #line 381 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r12() { $this->compiler->tag_nocache = true; $this->is_xml = true; $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode("", $this->compiler, true)); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("", $this->compiler, true)); $this->template->has_nocache_code = $save; } - #line 392 "../smarty/lexer/smarty_internal_templateparser.y" + #line 390 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r13() { if ($this->strip) { - $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor); } } - #line 401 "../smarty/lexer/smarty_internal_templateparser.y" + #line 399 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r14() { $this->strip = true; } - #line 405 "../smarty/lexer/smarty_internal_templateparser.y" + #line 403 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r15() { $this->strip = false; } - #line 409 "../smarty/lexer/smarty_internal_templateparser.y" + #line 407 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r16() { if ($this->strip) { @@ -2480,73 +2480,73 @@ class Smarty_Internal_Templateparser } } - #line 418 "../smarty/lexer/smarty_internal_templateparser.y" + #line 416 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r17() { $this->_retvalue = ''; } - #line 422 "../smarty/lexer/smarty_internal_templateparser.y" + #line 420 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r18() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor; } - #line 426 "../smarty/lexer/smarty_internal_templateparser.y" + #line 424 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r19() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 434 "../smarty/lexer/smarty_internal_templateparser.y" + #line 432 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r21() { $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } - #line 447 "../smarty/lexer/smarty_internal_templateparser.y" + #line 445 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r23() { $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 451 "../smarty/lexer/smarty_internal_templateparser.y" + #line 449 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r24() { $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 2]->minor, 'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor)); } - #line 455 "../smarty/lexer/smarty_internal_templateparser.y" + #line 453 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r25() { $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 1]->minor)); } - #line 459 "../smarty/lexer/smarty_internal_templateparser.y" + #line 457 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r26() { $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 2]->minor, 'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor)); } - #line 472 "../smarty/lexer/smarty_internal_templateparser.y" + #line 470 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r28() { $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[$this->yyidx + 0]->minor), array('var' => "'" . $this->yystack[$this->yyidx + - 2]->minor . "'"))); } - #line 480 "../smarty/lexer/smarty_internal_templateparser.y" + #line 478 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r30() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor), array('var' => "'" . $this->yystack[$this->yyidx + - 3]->minor . "'")), $this->yystack[$this->yyidx + 0]->minor)); } - #line 484 "../smarty/lexer/smarty_internal_templateparser.y" + #line 482 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r31() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor), array('var' => $this->yystack[$this->yyidx + - 3]->minor['var'])), $this->yystack[$this->yyidx + 0]->minor), array('smarty_internal_index' => $this->yystack[$this->yyidx + - 3]->minor['smarty_internal_index'])); } - #line 489 "../smarty/lexer/smarty_internal_templateparser.y" + #line 487 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r32() { if (defined($this->yystack[$this->yyidx + - 1]->minor)) { @@ -2556,7 +2556,7 @@ class Smarty_Internal_Templateparser } } - #line 496 "../smarty/lexer/smarty_internal_templateparser.y" + #line 494 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r33() { if (defined($this->yystack[$this->yyidx + 0]->minor)) { @@ -2566,7 +2566,7 @@ class Smarty_Internal_Templateparser } } - #line 506 "../smarty/lexer/smarty_internal_templateparser.y" + #line 504 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r34() { if (defined($this->yystack[$this->yyidx + - 2]->minor)) { @@ -2577,95 +2577,95 @@ class Smarty_Internal_Templateparser } } - #line 516 "../smarty/lexer/smarty_internal_templateparser.y" + #line 514 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r35() { $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor, array('object_method' => $this->yystack[$this->yyidx + - 1]->minor)); } - #line 521 "../smarty/lexer/smarty_internal_templateparser.y" + #line 519 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r36() { $this->_retvalue = '' . $this->compiler->compileTag($this->yystack[$this->yyidx + - 4]->minor, $this->yystack[$this->yyidx + 0]->minor, array('object_method' => $this->yystack[$this->yyidx + - 2]->minor)) . '_retvalue .= $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $this->yystack[$this->yyidx + - 1]->minor, 'value' => 'ob_get_clean()')) . ';?>'; } - #line 527 "../smarty/lexer/smarty_internal_templateparser.y" + #line 525 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r37() { $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 532 "../smarty/lexer/smarty_internal_templateparser.y" + #line 530 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r38() { $tag = trim(substr($this->yystack[$this->yyidx + - 2]->minor, $this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, $this->yystack[$this->yyidx + 0]->minor, array('if condition' => $this->yystack[$this->yyidx + - 1]->minor)); } - #line 537 "../smarty/lexer/smarty_internal_templateparser.y" + #line 535 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r39() { $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 548 "../smarty/lexer/smarty_internal_templateparser.y" + #line 546 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r41() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('start' => $this->yystack[$this->yyidx + - 9]->minor), array('ifexp' => $this->yystack[$this->yyidx + - 6]->minor), array('var' => $this->yystack[$this->yyidx + - 2]->minor), array('step' => $this->yystack[$this->yyidx + - 1]->minor))), 1); } - #line 552 "../smarty/lexer/smarty_internal_templateparser.y" + #line 550 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r42() { $this->_retvalue = '=' . $this->yystack[$this->yyidx + 0]->minor; } - #line 560 "../smarty/lexer/smarty_internal_templateparser.y" + #line 558 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r44() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('start' => $this->yystack[$this->yyidx + - 3]->minor), array('to' => $this->yystack[$this->yyidx + - 1]->minor))), 0); } - #line 564 "../smarty/lexer/smarty_internal_templateparser.y" + #line 562 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r45() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('start' => $this->yystack[$this->yyidx + - 5]->minor), array('to' => $this->yystack[$this->yyidx + - 3]->minor), array('step' => $this->yystack[$this->yyidx + - 1]->minor))), 0); } - #line 569 "../smarty/lexer/smarty_internal_templateparser.y" + #line 567 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r46() { $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[$this->yyidx + 0]->minor); } - #line 574 "../smarty/lexer/smarty_internal_templateparser.y" + #line 572 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r47() { $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('from' => $this->yystack[$this->yyidx + - 4]->minor), array('item' => $this->yystack[$this->yyidx + - 1]->minor)))); } - #line 578 "../smarty/lexer/smarty_internal_templateparser.y" + #line 576 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r48() { $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('from' => $this->yystack[$this->yyidx + - 7]->minor), array('item' => $this->yystack[$this->yyidx + - 1]->minor), array('key' => $this->yystack[$this->yyidx + - 4]->minor)))); } - #line 591 "../smarty/lexer/smarty_internal_templateparser.y" + #line 589 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r51() { $this->_retvalue = $this->compiler->compileTag('setfilter', array(), array('modifier_list' => array(array_merge(array($this->yystack[$this->yyidx + - 1]->minor), $this->yystack[$this->yyidx + 0]->minor)))); } - #line 595 "../smarty/lexer/smarty_internal_templateparser.y" + #line 593 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r52() { $this->_retvalue = $this->compiler->compileTag('setfilter', array(), array('modifier_list' => array_merge(array(array_merge(array($this->yystack[$this->yyidx + - 2]->minor), $this->yystack[$this->yyidx + - 1]->minor)), $this->yystack[$this->yyidx + 0]->minor))); } - #line 600 "../smarty/lexer/smarty_internal_templateparser.y" + #line 598 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r53() { $j = strrpos($this->yystack[$this->yyidx + 0]->minor, '.'); @@ -2678,212 +2678,205 @@ class Smarty_Internal_Templateparser } } - #line 613 "../smarty/lexer/smarty_internal_templateparser.y" + #line 611 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r54() { $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor . 'close', array()); } - #line 617 "../smarty/lexer/smarty_internal_templateparser.y" + #line 615 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r55() { $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 1]->minor . 'close', array(), array('modifier_list' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 622 "../smarty/lexer/smarty_internal_templateparser.y" + #line 620 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r56() { $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 2]->minor . 'close', array(), array('object_method' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 626 "../smarty/lexer/smarty_internal_templateparser.y" + #line 624 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r57() { $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 3]->minor . 'close', array(), array('object_method' => $this->yystack[$this->yyidx + - 1]->minor, 'modifier_list' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 634 "../smarty/lexer/smarty_internal_templateparser.y" + #line 632 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r58() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; } - #line 640 "../smarty/lexer/smarty_internal_templateparser.y" + #line 638 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r59() { $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } - #line 645 "../smarty/lexer/smarty_internal_templateparser.y" + #line 643 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r60() { $this->_retvalue = array(); } - #line 650 "../smarty/lexer/smarty_internal_templateparser.y" + #line 648 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r61() { - if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => 'true'); - } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => 'false'); - } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => 'null'); + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor); } else { $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => "'" . $this->yystack[$this->yyidx + 0]->minor . "'"); } } - #line 662 "../smarty/lexer/smarty_internal_templateparser.y" + #line 656 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r62() { $this->_retvalue = array(trim($this->yystack[$this->yyidx + - 1]->minor, " =\n\r\t") => $this->yystack[$this->yyidx + 0]->minor); } - #line 670 "../smarty/lexer/smarty_internal_templateparser.y" + #line 664 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r64() { $this->_retvalue = "'" . $this->yystack[$this->yyidx + 0]->minor . "'"; } - #line 682 "../smarty/lexer/smarty_internal_templateparser.y" + #line 676 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r67() { $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor); } - #line 695 "../smarty/lexer/smarty_internal_templateparser.y" + #line 689 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r69() { $this->yystack[$this->yyidx + - 2]->minor[] = $this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor; } - #line 700 "../smarty/lexer/smarty_internal_templateparser.y" + #line 694 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r70() { $this->_retvalue = array('var' => $this->yystack[$this->yyidx + - 2]->minor, 'value' => $this->yystack[$this->yyidx + 0]->minor); } - #line 728 "../smarty/lexer/smarty_internal_templateparser.y" + #line 722 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r75() { $this->_retvalue = '$_smarty_tpl->getStreamVariable(\'' . $this->yystack[$this->yyidx + - 2]->minor . '://' . $this->yystack[$this->yyidx + 0]->minor . '\')'; } - #line 733 "../smarty/lexer/smarty_internal_templateparser.y" + #line 727 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r76() { $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . trim($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor; } - #line 752 "../smarty/lexer/smarty_internal_templateparser.y" + #line 746 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r80() { $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), array('value' => $this->yystack[$this->yyidx + - 1]->minor, 'modifierlist' => $this->yystack[$this->yyidx + 0]->minor)); } - #line 758 "../smarty/lexer/smarty_internal_templateparser.y" + #line 752 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r81() { $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 762 "../smarty/lexer/smarty_internal_templateparser.y" + #line 756 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r82() { $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 766 "../smarty/lexer/smarty_internal_templateparser.y" + #line 760 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r83() { $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',(array)' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 774 "../smarty/lexer/smarty_internal_templateparser.y" + #line 768 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r85() { $this->_retvalue = '!(' . $this->yystack[$this->yyidx + - 2]->minor . ' % ' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 778 "../smarty/lexer/smarty_internal_templateparser.y" + #line 772 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r86() { $this->_retvalue = '(' . $this->yystack[$this->yyidx + - 2]->minor . ' % ' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 782 "../smarty/lexer/smarty_internal_templateparser.y" + #line 776 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r87() { $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')'; } - #line 786 "../smarty/lexer/smarty_internal_templateparser.y" + #line 780 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r88() { $this->_retvalue = '(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')'; } - #line 790 "../smarty/lexer/smarty_internal_templateparser.y" + #line 784 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r89() { $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 2]->minor . ' / ' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 794 "../smarty/lexer/smarty_internal_templateparser.y" + #line 788 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r90() { $this->_retvalue = '(1 & ' . $this->yystack[$this->yyidx + - 2]->minor . ' / ' . $this->yystack[$this->yyidx + 0]->minor . ')'; } - #line 814 "../smarty/lexer/smarty_internal_templateparser.y" + #line 808 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r95() { - // self::$prefix_number++; - // $this->compiler->prefix_code[] = 'yystack[$this->yyidx + -2]->minor.';? >'; - // $this->_retvalue = '$_tmp'.self::$prefix_number.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 825 "../smarty/lexer/smarty_internal_templateparser.y" + #line 816 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r96() { $this->_retvalue = $this->yystack[$this->yyidx + - 6]->minor . ' ? ' . $this->compileVariable("'" . $this->yystack[$this->yyidx + - 2]->minor . "'") . ' : ' . $this->yystack[$this->yyidx + 0]->minor; } - #line 829 "../smarty/lexer/smarty_internal_templateparser.y" + #line 820 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r97() { $this->_retvalue = $this->yystack[$this->yyidx + - 5]->minor . ' ? ' . $this->yystack[$this->yyidx + - 2]->minor . ' : ' . $this->yystack[$this->yyidx + 0]->minor; } - #line 844 "../smarty/lexer/smarty_internal_templateparser.y" + #line 835 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r100() { $this->_retvalue = '!' . $this->yystack[$this->yyidx + 0]->minor; } - #line 865 "../smarty/lexer/smarty_internal_templateparser.y" + #line 856 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r105() { $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor; } - #line 869 "../smarty/lexer/smarty_internal_templateparser.y" + #line 860 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r106() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.'; } - #line 873 "../smarty/lexer/smarty_internal_templateparser.y" + #line 864 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r107() { $this->_retvalue = '.' . $this->yystack[$this->yyidx + 0]->minor; } - #line 878 "../smarty/lexer/smarty_internal_templateparser.y" + #line 869 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r108() { if (defined($this->yystack[$this->yyidx + 0]->minor)) { @@ -2893,13 +2886,13 @@ class Smarty_Internal_Templateparser } } - #line 892 "../smarty/lexer/smarty_internal_templateparser.y" + #line 883 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r110() { $this->_retvalue = "(" . $this->yystack[$this->yyidx + - 1]->minor . ")"; } - #line 907 "../smarty/lexer/smarty_internal_templateparser.y" + #line 898 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r113() { self::$prefix_number ++; @@ -2911,7 +2904,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = '$_tmp' . self::$prefix_number . '::' . $this->yystack[$this->yyidx + 0]->minor; } - #line 919 "../smarty/lexer/smarty_internal_templateparser.y" + #line 910 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r114() { self::$prefix_number ++; @@ -2919,7 +2912,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = '$_tmp' . self::$prefix_number; } - #line 935 "../smarty/lexer/smarty_internal_templateparser.y" + #line 926 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r117() { if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + - 2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + - 2]->minor, $this->compiler)) { @@ -2929,11 +2922,11 @@ class Smarty_Internal_Templateparser $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '::' . $this->yystack[$this->yyidx + 0]->minor; } } else { - $this->compiler->error("static class '" . $this->yystack[$this->yyidx + - 2]->minor . "' is undefined or not allowed by security setting"); + $this->compiler->trigger_template_error("static class '" . $this->yystack[$this->yyidx + - 2]->minor . "' is undefined or not allowed by security setting"); } } - #line 969 "../smarty/lexer/smarty_internal_templateparser.y" + #line 960 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r121() { if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { @@ -2947,61 +2940,61 @@ class Smarty_Internal_Templateparser } } - #line 982 "../smarty/lexer/smarty_internal_templateparser.y" + #line 973 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r122() { $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[$this->yyidx + - 2]->minor . ']->' . $this->yystack[$this->yyidx + 0]->minor; } - #line 992 "../smarty/lexer/smarty_internal_templateparser.y" + #line 983 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r124() { $this->_retvalue = '$_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 1]->minor . '\')'; } - #line 996 "../smarty/lexer/smarty_internal_templateparser.y" + #line 987 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r125() { $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 2]->minor . '\')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' :null)'; } - #line 1000 "../smarty/lexer/smarty_internal_templateparser.y" + #line 991 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r126() { $this->_retvalue = '$_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 1]->minor . ')'; } - #line 1004 "../smarty/lexer/smarty_internal_templateparser.y" + #line 995 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r127() { $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 2]->minor . ')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' : null)'; } - #line 1008 "../smarty/lexer/smarty_internal_templateparser.y" + #line 999 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r128() { $this->_retvalue = array('var' => $this->yystack[$this->yyidx + - 1]->minor, 'smarty_internal_index' => $this->yystack[$this->yyidx + 0]->minor); } - #line 1021 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1012 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r130() { return; } - #line 1027 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1018 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r131() { $this->_retvalue = '[' . $this->compileVariable($this->yystack[$this->yyidx + 0]->minor) . ']'; } - #line 1031 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1022 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r132() { $this->_retvalue = '[' . $this->compileVariable($this->yystack[$this->yyidx + - 2]->minor) . '->' . $this->yystack[$this->yyidx + 0]->minor . ']'; } - #line 1035 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1026 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r133() { if (defined($this->yystack[$this->yyidx + 0]->minor)) { @@ -3011,55 +3004,55 @@ class Smarty_Internal_Templateparser } } - #line 1043 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1034 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r134() { $this->_retvalue = "[" . $this->yystack[$this->yyidx + 0]->minor . "]"; } - #line 1048 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1039 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r135() { $this->_retvalue = "[" . $this->yystack[$this->yyidx + - 1]->minor . "]"; } - #line 1053 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1044 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r136() { $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\'][\'index\']') . ']'; } - #line 1057 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1048 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r137() { $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 3]->minor . '\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\']') . ']'; } - #line 1067 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1058 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r139() { $this->_retvalue = '[]'; } - #line 1081 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1072 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r141() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor; } - #line 1086 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1077 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r142() { $this->_retvalue = '\'' . $this->yystack[$this->yyidx + 0]->minor . '\''; } - #line 1091 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1082 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r143() { $this->_retvalue = '(' . $this->yystack[$this->yyidx + - 1]->minor . ')'; } - #line 1098 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1089 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r144() { if ($this->yystack[$this->yyidx + - 1]->minor['var'] == '\'smarty\'') { @@ -3069,19 +3062,19 @@ class Smarty_Internal_Templateparser } } - #line 1107 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1098 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r145() { $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } - #line 1112 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1103 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r146() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 1117 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1108 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r147() { if ($this->security && substr($this->yystack[$this->yyidx + - 1]->minor, 0, 1) == '_') { @@ -3090,7 +3083,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = '->' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 1124 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1115 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r148() { if ($this->security) { @@ -3099,7 +3092,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = '->{' . $this->compileVariable($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor . '}'; } - #line 1131 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1122 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r149() { if ($this->security) { @@ -3108,7 +3101,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = '->{' . $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + 0]->minor . '}'; } - #line 1138 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1129 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r150() { if ($this->security) { @@ -3117,13 +3110,13 @@ class Smarty_Internal_Templateparser $this->_retvalue = '->{\'' . $this->yystack[$this->yyidx + - 4]->minor . '\'.' . $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + 0]->minor . '}'; } - #line 1146 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1137 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r151() { $this->_retvalue = '->' . $this->yystack[$this->yyidx + 0]->minor; } - #line 1154 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1145 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r152() { if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + - 3]->minor, $this->compiler)) { @@ -3160,7 +3153,7 @@ class Smarty_Internal_Templateparser } } - #line 1193 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1184 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r153() { if ($this->security && substr($this->yystack[$this->yyidx + - 3]->minor, 0, 1) == '_') { @@ -3169,7 +3162,7 @@ class Smarty_Internal_Templateparser $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . "(" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ")"; } - #line 1200 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1191 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r154() { if ($this->security) { @@ -3180,197 +3173,197 @@ class Smarty_Internal_Templateparser $this->_retvalue = '$_tmp' . self::$prefix_number . '(' . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ')'; } - #line 1211 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1202 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r155() { $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 2]->minor, array($this->yystack[$this->yyidx + 0]->minor)); } - #line 1228 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1219 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r158() { $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 2]->minor, array(array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor))); } - #line 1232 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1223 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r159() { $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor)); } - #line 1240 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1231 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r161() { $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } - #line 1248 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1239 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r162() { $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor); } - #line 1282 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1273 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r169() { $this->_retvalue = '$' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 1287 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1278 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r170() { $this->_retvalue = '$' . $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor; } - #line 1293 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1284 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r171() { $this->_retvalue = '=='; } - #line 1297 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1288 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r172() { $this->_retvalue = '!='; } - #line 1301 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1292 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r173() { $this->_retvalue = '>'; } - #line 1305 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1296 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r174() { $this->_retvalue = '<'; } - #line 1309 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1300 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r175() { $this->_retvalue = '>='; } - #line 1313 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1304 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r176() { $this->_retvalue = '<='; } - #line 1317 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1308 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r177() { $this->_retvalue = '==='; } - #line 1321 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1312 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r178() { $this->_retvalue = '!=='; } - #line 1325 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1316 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r179() { $this->_retvalue = '%'; } - #line 1329 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1320 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r180() { $this->_retvalue = '&&'; } - #line 1333 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1324 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r181() { $this->_retvalue = '||'; } - #line 1337 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1328 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r182() { $this->_retvalue = ' XOR '; } - #line 1344 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1335 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r183() { $this->_retvalue = 'array(' . $this->yystack[$this->yyidx + - 1]->minor . ')'; } - #line 1352 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1343 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r185() { $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor; } - #line 1360 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1351 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r187() { $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '=>' . $this->yystack[$this->yyidx + 0]->minor; } - #line 1364 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1355 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r188() { $this->_retvalue = '\'' . $this->yystack[$this->yyidx + - 2]->minor . '\'=>' . $this->yystack[$this->yyidx + 0]->minor; } - #line 1376 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1367 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r190() { $this->_retvalue = "''"; } - #line 1380 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1371 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r191() { $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor->to_smarty_php(); } - #line 1385 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1376 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r192() { $this->yystack[$this->yyidx + - 1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor; } - #line 1390 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1381 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r193() { - $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[$this->yyidx + 0]->minor); } - #line 1394 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1385 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r194() { - $this->_retvalue = new _smarty_code($this, '(string)' . $this->yystack[$this->yyidx + - 1]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)' . $this->yystack[$this->yyidx + - 1]->minor); } - #line 1402 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1393 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r196() { - $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\']->value'); + $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)$_smarty_tpl->tpl_vars[\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\']->value'); } - #line 1410 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1401 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r198() { - $this->_retvalue = new _smarty_code($this, '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')'); + $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')'); } - #line 1414 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1405 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r199() { - $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + - 1]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[$this->yyidx + - 1]->minor); } - #line 1418 "../smarty/lexer/smarty_internal_templateparser.y" + #line 1409 "../smarty/lexer/smarty_internal_templateparser.y" function yy_r200() { - $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this, $this->yystack[$this->yyidx + 0]->minor); } private $_retvalue; @@ -3429,7 +3422,7 @@ class Smarty_Internal_Templateparser public function yy_syntax_error($yymajor, $TOKEN) { - #line 208 "../smarty/lexer/smarty_internal_templateparser.y" + #line 206 "../smarty/lexer/smarty_internal_templateparser.y" $this->internalError = true; $this->yymajor = $yymajor; @@ -3449,8 +3442,6 @@ class Smarty_Internal_Templateparser $this->successful = !$this->internalError; $this->internalError = false; $this->retvalue = $this->_retvalue; - //echo $this->retvalue."\n\n"; - } public function doParse($yymajor, $yytokenvalue)