From 7255b4d73cccb995b72560b365eb0af62327e64c Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 25 Mar 2024 13:44:06 +0100 Subject: [PATCH 1/9] Internal compiler classes always return a string (#918) * Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity) * Add :string method signature to compile method everywhere. --- TODO.txt | 1 - changelog/918.md | 1 + src/Compile/Base.php | 4 +- src/Compile/BlockCompiler.php | 5 +- src/Compile/CompilerInterface.php | 4 +- .../DefaultHandlerFunctionCallCompiler.php | 3 +- src/Compile/FunctionCallCompiler.php | 3 +- src/Compile/ModifierCompiler.php | 5 +- src/Compile/ObjectMethodCallCompiler.php | 3 +- src/Compile/PrintExpressionCompiler.php | 5 +- src/Compile/SpecialVariableCompiler.php | 7 +- src/Compile/Tag/Append.php | 4 +- src/Compile/Tag/Assign.php | 4 +- src/Compile/Tag/BCPluginWrapper.php | 3 +- src/Compile/Tag/Block.php | 3 +- src/Compile/Tag/BlockClose.php | 3 +- src/Compile/Tag/BreakTag.php | 2 +- src/Compile/Tag/Call.php | 3 +- src/Compile/Tag/Capture.php | 6 +- src/Compile/Tag/CaptureClose.php | 3 +- src/Compile/Tag/ConfigLoad.php | 3 +- src/Compile/Tag/Debug.php | 3 +- src/Compile/Tag/ElseIfTag.php | 3 +- src/Compile/Tag/ElseTag.php | 3 +- src/Compile/Tag/EvalTag.php | 3 +- src/Compile/Tag/ExtendsTag.php | 4 +- src/Compile/Tag/ForClose.php | 3 +- src/Compile/Tag/ForElse.php | 3 +- src/Compile/Tag/ForTag.php | 3 +- src/Compile/Tag/ForeachClose.php | 3 +- src/Compile/Tag/ForeachElse.php | 3 +- src/Compile/Tag/ForeachTag.php | 3 +- src/Compile/Tag/FunctionClose.php | 7 +- src/Compile/Tag/FunctionTag.php | 7 +- src/Compile/Tag/IfClose.php | 3 +- src/Compile/Tag/IfTag.php | 3 +- src/Compile/Tag/IncludeTag.php | 3 +- src/Compile/Tag/Ldelim.php | 3 +- src/Compile/Tag/Nocache.php | 9 +- src/Compile/Tag/NocacheClose.php | 9 +- src/Compile/Tag/Rdelim.php | 3 +- src/Compile/Tag/Section.php | 3 +- src/Compile/Tag/SectionClose.php | 3 +- src/Compile/Tag/SectionElse.php | 3 +- src/Compile/Tag/Setfilter.php | 7 +- src/Compile/Tag/SetfilterClose.php | 7 +- src/Compile/Tag/WhileClose.php | 3 +- src/Compile/Tag/WhileTag.php | 3 +- src/Compiler/Template.php | 22 +- src/Parser/TemplateParser.php | 270 +++++++++--------- src/Parser/TemplateParser.y | 4 +- .../UnitTests/SecurityTests/SecurityTest.php | 2 +- .../RegisterBlock/RegisterBlockTest.php | 3 +- .../PHPunitplugins/compiler.test.php | 3 +- .../PHPunitplugins/compiler.testclose.php | 3 +- .../PluginFunctionFetchTest.php | 2 +- .../TemplateFunction/CompileFunctionTest.php | 1 - .../compiler.getparamsshort.php | 4 +- 58 files changed, 253 insertions(+), 246 deletions(-) create mode 100644 changelog/918.md diff --git a/TODO.txt b/TODO.txt index 9cde6dc58..aabbf6543 100644 --- a/TODO.txt +++ b/TODO.txt @@ -29,5 +29,4 @@ ## Unrelated / other - review (and avoid) use of 'clone' keyword -- compiler->has_code seems silly. Why not have proper return values? - what is 'user literal support', why are unit tests skipped? diff --git a/changelog/918.md b/changelog/918.md new file mode 100644 index 000000000..853fdd12e --- /dev/null +++ b/changelog/918.md @@ -0,0 +1 @@ +- Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity) [#918](https://github.com/smarty-php/smarty/pull/918) diff --git a/src/Compile/Base.php b/src/Compile/Base.php index adee289ab..2d5c0c0ef 100644 --- a/src/Compile/Base.php +++ b/src/Compile/Base.php @@ -226,8 +226,8 @@ protected function convertScope($scope): int { * @param Template $compiler compiler object * @param array $parameter array with compilation parameter * - * @return bool|string compiled code or true if no code has been compiled + * @return string compiled code as a string * @throws \Smarty\CompilerException */ - abstract public function compile($args, Template $compiler, $parameter = array(), $tag = null, $function = null); + abstract public function compile($args, Template $compiler, $parameter = array(), $tag = null, $function = null): string; } diff --git a/src/Compile/BlockCompiler.php b/src/Compile/BlockCompiler.php index 089e618d7..e7a8f310e 100644 --- a/src/Compile/BlockCompiler.php +++ b/src/Compile/BlockCompiler.php @@ -50,7 +50,8 @@ class BlockCompiler extends Base { * @throws CompilerException * @throws Exception */ - public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null): string + { if (!isset($tag[5]) || substr($tag, -5) !== 'close') { $output = $this->compileOpeningTag($compiler, $args, $tag, $function); @@ -77,7 +78,6 @@ public function compileChild(\Smarty\Compiler\Template $compiler) { ); } $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]['callsChild'] = true; - $compiler->has_code = true; $compiler->suppressNocacheProcessing = true; $output = "getParser()->lex->taglineno ); } - $compiler->has_code = true; $compiler->suppressNocacheProcessing = true; $output = "getAttributes($compiler, $args); unset($_attr['nocache']); diff --git a/src/Compile/FunctionCallCompiler.php b/src/Compile/FunctionCallCompiler.php index 8934c8d7c..107dd98bb 100644 --- a/src/Compile/FunctionCallCompiler.php +++ b/src/Compile/FunctionCallCompiler.php @@ -49,7 +49,8 @@ class FunctionCallCompiler extends Base { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/src/Compile/ModifierCompiler.php b/src/Compile/ModifierCompiler.php index 765e83768..4e6232244 100644 --- a/src/Compile/ModifierCompiler.php +++ b/src/Compile/ModifierCompiler.php @@ -33,9 +33,8 @@ class ModifierCompiler extends Base { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { - - $compiler->has_code = true; + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $output = $parameter['value']; diff --git a/src/Compile/ObjectMethodCallCompiler.php b/src/Compile/ObjectMethodCallCompiler.php index f3ce69605..70855cfc8 100644 --- a/src/Compile/ObjectMethodCallCompiler.php +++ b/src/Compile/ObjectMethodCallCompiler.php @@ -39,7 +39,8 @@ class ObjectMethodCallCompiler extends Base { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); unset($_attr['nocache']); diff --git a/src/Compile/PrintExpressionCompiler.php b/src/Compile/PrintExpressionCompiler.php index 486512d4f..3302254f9 100644 --- a/src/Compile/PrintExpressionCompiler.php +++ b/src/Compile/PrintExpressionCompiler.php @@ -47,9 +47,8 @@ class PrintExpressionCompiler extends Base { * @return string * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { - - $compiler->has_code = true; + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/src/Compile/SpecialVariableCompiler.php b/src/Compile/SpecialVariableCompiler.php index 08f9aa69f..2b6cf4330 100644 --- a/src/Compile/SpecialVariableCompiler.php +++ b/src/Compile/SpecialVariableCompiler.php @@ -37,9 +37,8 @@ class SpecialVariableCompiler extends Base { * @return string compiled code * @throws CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { - - $compiler->has_code = true; + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $_index = preg_split("/\]\[/", substr($parameter, 1, strlen($parameter) - 2)); $variable = smarty_strtolower_ascii($compiler->getId($_index[0])); @@ -129,5 +128,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = } return $compiled_ref; } + + return ''; } } diff --git a/src/Compile/Tag/Append.php b/src/Compile/Tag/Append.php index 86eda99e9..171f69600 100644 --- a/src/Compile/Tag/Append.php +++ b/src/Compile/Tag/Append.php @@ -35,8 +35,8 @@ class Append extends Assign * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null) - { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/src/Compile/Tag/Assign.php b/src/Compile/Tag/Assign.php index f53bdf333..8433a97e1 100644 --- a/src/Compile/Tag/Assign.php +++ b/src/Compile/Tag/Assign.php @@ -55,8 +55,8 @@ class Assign extends Base * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null) - { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null): string + { $_nocache = false; // check and get attributes diff --git a/src/Compile/Tag/BCPluginWrapper.php b/src/Compile/Tag/BCPluginWrapper.php index 0224250d0..abd89f78f 100644 --- a/src/Compile/Tag/BCPluginWrapper.php +++ b/src/Compile/Tag/BCPluginWrapper.php @@ -24,7 +24,8 @@ public function __construct($callback, bool $cacheable = true) { /** * @inheritDoc */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { return call_user_func($this->callback, $this->getAttributes($compiler, $args), $compiler->getSmarty()); } } \ No newline at end of file diff --git a/src/Compile/Tag/Block.php b/src/Compile/Tag/Block.php index ce6df4f77..d8b301006 100644 --- a/src/Compile/Tag/Block.php +++ b/src/Compile/Tag/Block.php @@ -58,7 +58,7 @@ class Block extends Inheritance { * @param \Smarty\Compiler\Template $compiler compiler object * @param array $parameter array with compilation parameter */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null) + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null): string { if (!isset($compiler->_cache['blockNesting'])) { $compiler->_cache['blockNesting'] = 0; @@ -87,5 +87,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = $compiler->getParser()->current_buffer = new Template(); $compiler->getTemplate()->getCompiled()->setNocacheCode(false); $compiler->suppressNocacheProcessing = true; + return ''; } } diff --git a/src/Compile/Tag/BlockClose.php b/src/Compile/Tag/BlockClose.php index 0c0520016..586c7c050 100644 --- a/src/Compile/Tag/BlockClose.php +++ b/src/Compile/Tag/BlockClose.php @@ -18,7 +18,7 @@ class BlockClose extends Inheritance { * * @return bool true */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null) + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null): string { [$_attr, $_nocache, $_buffer, $_has_nocache_code, $_className] = $this->closeTag($compiler, ['block']); @@ -103,7 +103,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = if ($compiler->_cache['blockNesting'] === 0) { unset($compiler->_cache['blockNesting']); } - $compiler->has_code = true; $compiler->suppressNocacheProcessing = true; return $output; } diff --git a/src/Compile/Tag/BreakTag.php b/src/Compile/Tag/BreakTag.php index 0ec03df2f..b8b554f3b 100644 --- a/src/Compile/Tag/BreakTag.php +++ b/src/Compile/Tag/BreakTag.php @@ -52,7 +52,7 @@ class BreakTag extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null) + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = array(), $tag = null, $function = null): string { [$levels, $foreachLevels] = $this->checkLevels($args, $compiler); $output = "getAttributes($compiler, $args); // save possible attributes diff --git a/src/Compile/Tag/Capture.php b/src/Compile/Tag/Capture.php index fc8804a0a..7b7362f9e 100644 --- a/src/Compile/Tag/Capture.php +++ b/src/Compile/Tag/Capture.php @@ -53,7 +53,8 @@ public static function compileSpecialVariable( * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); $buffer = $_attr['name'] ?? "'default'"; @@ -66,7 +67,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = $compiler->openTag('nocache'); } - $_output = "getSmarty()->getRuntime('Capture')->open(\$_smarty_tpl, $buffer, $assign, $append);?>"; - return $_output; + return "getSmarty()->getRuntime('Capture')->open(\$_smarty_tpl, $buffer, $assign, $append);?>"; } } \ No newline at end of file diff --git a/src/Compile/Tag/CaptureClose.php b/src/Compile/Tag/CaptureClose.php index 0d553a2b9..c0d779692 100644 --- a/src/Compile/Tag/CaptureClose.php +++ b/src/Compile/Tag/CaptureClose.php @@ -29,7 +29,8 @@ class CaptureClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { if (array_pop($compiler->_cache['capture_stack'])) { // pop the virtual {nocache} tag from the stack. diff --git a/src/Compile/Tag/ConfigLoad.php b/src/Compile/Tag/ConfigLoad.php index 6425749ec..d9e67ec92 100644 --- a/src/Compile/Tag/ConfigLoad.php +++ b/src/Compile/Tag/ConfigLoad.php @@ -62,7 +62,8 @@ class ConfigLoad extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); if ($_attr['nocache'] === true) { diff --git a/src/Compile/Tag/Debug.php b/src/Compile/Tag/Debug.php index bd8998921..4542bd3cd 100644 --- a/src/Compile/Tag/Debug.php +++ b/src/Compile/Tag/Debug.php @@ -29,7 +29,8 @@ class Debug extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes, may trigger errors $this->getAttributes($compiler, $args); diff --git a/src/Compile/Tag/ElseIfTag.php b/src/Compile/Tag/ElseIfTag.php index 60b888a86..8e59c3413 100644 --- a/src/Compile/Tag/ElseIfTag.php +++ b/src/Compile/Tag/ElseIfTag.php @@ -22,7 +22,8 @@ class ElseIfTag extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$nesting, $nocache_pushed] = $this->closeTag($compiler, ['if', 'elseif']); diff --git a/src/Compile/Tag/ElseTag.php b/src/Compile/Tag/ElseTag.php index 68a9a0230..a7025da72 100644 --- a/src/Compile/Tag/ElseTag.php +++ b/src/Compile/Tag/ElseTag.php @@ -20,7 +20,8 @@ class ElseTag extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$nesting, $compiler->tag_nocache] = $this->closeTag($compiler, ['if', 'elseif']); $this->openTag($compiler, 'else', [$nesting, $compiler->tag_nocache]); return ''; diff --git a/src/Compile/Tag/EvalTag.php b/src/Compile/Tag/EvalTag.php index c6535570e..8396fd097 100644 --- a/src/Compile/Tag/EvalTag.php +++ b/src/Compile/Tag/EvalTag.php @@ -52,7 +52,8 @@ class EvalTag extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); if (isset($_attr['assign'])) { diff --git a/src/Compile/Tag/ExtendsTag.php b/src/Compile/Tag/ExtendsTag.php index 2e9e0aed5..dcdbbc976 100644 --- a/src/Compile/Tag/ExtendsTag.php +++ b/src/Compile/Tag/ExtendsTag.php @@ -52,7 +52,8 @@ class ExtendsTag extends Inheritance { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); if ($_attr['nocache'] === true) { @@ -86,7 +87,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = } else { $this->compileEndChild($compiler, $_attr['file']); } - $compiler->has_code = false; return ''; } diff --git a/src/Compile/Tag/ForClose.php b/src/Compile/Tag/ForClose.php index bde1a0751..189bcfd93 100644 --- a/src/Compile/Tag/ForClose.php +++ b/src/Compile/Tag/ForClose.php @@ -29,7 +29,8 @@ class ForClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting--; [$openTag, $nocache_pushed] = $this->closeTag($compiler, ['for', 'forelse']); diff --git a/src/Compile/Tag/ForElse.php b/src/Compile/Tag/ForElse.php index a754a0d50..d939a72ab 100644 --- a/src/Compile/Tag/ForElse.php +++ b/src/Compile/Tag/ForElse.php @@ -21,7 +21,8 @@ class ForElse extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$tagName, $nocache_pushed] = $this->closeTag($compiler, ['for']); $this->openTag($compiler, 'forelse', ['forelse', $nocache_pushed]); return ""; diff --git a/src/Compile/Tag/ForTag.php b/src/Compile/Tag/ForTag.php index 8066d83e7..fdf71b681 100644 --- a/src/Compile/Tag/ForTag.php +++ b/src/Compile/Tag/ForTag.php @@ -28,7 +28,8 @@ class ForTag extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting++; if ($parameter === 0) { $this->required_attributes = ['start', 'to']; diff --git a/src/Compile/Tag/ForeachClose.php b/src/Compile/Tag/ForeachClose.php index 805991493..e657c1d84 100644 --- a/src/Compile/Tag/ForeachClose.php +++ b/src/Compile/Tag/ForeachClose.php @@ -29,7 +29,8 @@ class ForeachClose extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting--; [$openTag, $nocache_pushed, $localVariablePrefix, $item, $restore] = $this->closeTag($compiler, ['foreach', 'foreachelse']); diff --git a/src/Compile/Tag/ForeachElse.php b/src/Compile/Tag/ForeachElse.php index 3397bb4f0..d48898473 100644 --- a/src/Compile/Tag/ForeachElse.php +++ b/src/Compile/Tag/ForeachElse.php @@ -20,7 +20,8 @@ class ForeachElse extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$openTag, $nocache_pushed, $localVariablePrefix, $item, $restore] = $this->closeTag($compiler, ['foreach']); $this->openTag($compiler, 'foreachelse', ['foreachelse', $nocache_pushed, $localVariablePrefix, $item, false]); diff --git a/src/Compile/Tag/ForeachTag.php b/src/Compile/Tag/ForeachTag.php index c77a5464f..9f765af58 100644 --- a/src/Compile/Tag/ForeachTag.php +++ b/src/Compile/Tag/ForeachTag.php @@ -79,7 +79,8 @@ class ForeachTag extends ForeachSection { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting++; // init $this->isNamed = false; diff --git a/src/Compile/Tag/FunctionClose.php b/src/Compile/Tag/FunctionClose.php index 119db13ce..aff6dc658 100644 --- a/src/Compile/Tag/FunctionClose.php +++ b/src/Compile/Tag/FunctionClose.php @@ -33,9 +33,10 @@ class FunctionClose extends Base { * @param array $args array with attributes from parser * @param object|\Smarty\Compiler\Template $compiler compiler object * - * @return bool true + * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->compiler = $compiler; $saved_data = $this->closeTag($compiler, ['function']); $_attr = $saved_data[0]; @@ -140,7 +141,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = // restore old status $compiler->getTemplate()->getCompiled()->setNocacheCode($saved_data[2]); $compiler->getTemplate()->caching = $saved_data[3]; - return true; + return ''; } /** diff --git a/src/Compile/Tag/FunctionTag.php b/src/Compile/Tag/FunctionTag.php index aa41abdba..c291c3dee 100644 --- a/src/Compile/Tag/FunctionTag.php +++ b/src/Compile/Tag/FunctionTag.php @@ -42,10 +42,11 @@ class FunctionTag extends Base { * @param array $args array with attributes from parser * @param \Smarty\Compiler\Template $compiler compiler object * - * @return bool true + * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); if ($_attr['nocache'] === true) { @@ -67,6 +68,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = // Init temporary context $compiler->getParser()->current_buffer = new \Smarty\ParseTree\Template(); $compiler->getTemplate()->getCompiled()->setNocacheCode(false); - return true; + return ''; } } \ No newline at end of file diff --git a/src/Compile/Tag/IfClose.php b/src/Compile/Tag/IfClose.php index 12f7e4427..df15094f1 100644 --- a/src/Compile/Tag/IfClose.php +++ b/src/Compile/Tag/IfClose.php @@ -28,7 +28,8 @@ class IfClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$nesting, $nocache_pushed] = $this->closeTag($compiler, ['if', 'else', 'elseif']); diff --git a/src/Compile/Tag/IfTag.php b/src/Compile/Tag/IfTag.php index 84bf477c0..7790859b1 100644 --- a/src/Compile/Tag/IfTag.php +++ b/src/Compile/Tag/IfTag.php @@ -22,7 +22,8 @@ class IfTag extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { if ($compiler->tag_nocache) { // push a {nocache} tag onto the stack to prevent caching of this block diff --git a/src/Compile/Tag/IncludeTag.php b/src/Compile/Tag/IncludeTag.php index f7619cc71..8e775811e 100644 --- a/src/Compile/Tag/IncludeTag.php +++ b/src/Compile/Tag/IncludeTag.php @@ -67,7 +67,8 @@ class IncludeTag extends Base { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $uid = $t_hash = null; // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/src/Compile/Tag/Ldelim.php b/src/Compile/Tag/Ldelim.php index 5a48d3ada..a265fa70c 100644 --- a/src/Compile/Tag/Ldelim.php +++ b/src/Compile/Tag/Ldelim.php @@ -30,7 +30,8 @@ class Ldelim extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $_attr = $this->getAttributes($compiler, $args); if ($_attr['nocache'] === true) { $compiler->trigger_template_error('nocache option not allowed', null, true); diff --git a/src/Compile/Tag/Nocache.php b/src/Compile/Tag/Nocache.php index 5e2cbd314..dd30f8937 100644 --- a/src/Compile/Tag/Nocache.php +++ b/src/Compile/Tag/Nocache.php @@ -26,12 +26,11 @@ class Nocache extends Base { * @param array $args array with attributes from parser * @param \Smarty\Compiler\Template $compiler compiler object * - * @return bool + * @return string */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->openTag($compiler, 'nocache'); - // this tag does not return compiled code - $compiler->has_code = false; - return true; + return ''; } } \ No newline at end of file diff --git a/src/Compile/Tag/NocacheClose.php b/src/Compile/Tag/NocacheClose.php index cacbf701c..75edd9982 100644 --- a/src/Compile/Tag/NocacheClose.php +++ b/src/Compile/Tag/NocacheClose.php @@ -27,12 +27,11 @@ class NocacheClose extends Base { * @param array $args array with attributes from parser * @param \Smarty\Compiler\Template $compiler compiler object * - * @return bool + * @return string */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->closeTag($compiler, ['nocache']); - // this tag does not return compiled code - $compiler->has_code = false; - return true; + return ''; } } diff --git a/src/Compile/Tag/Rdelim.php b/src/Compile/Tag/Rdelim.php index 87bd18897..60e7a23d1 100644 --- a/src/Compile/Tag/Rdelim.php +++ b/src/Compile/Tag/Rdelim.php @@ -28,7 +28,8 @@ class Rdelim extends Ldelim { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { parent::compile($args, $compiler); return $compiler->getTemplate()->getRightDelimiter(); } diff --git a/src/Compile/Tag/Section.php b/src/Compile/Tag/Section.php index de9202c53..f82ac4211 100644 --- a/src/Compile/Tag/Section.php +++ b/src/Compile/Tag/Section.php @@ -82,7 +82,8 @@ class Section extends ForeachSection { * @throws \Smarty\CompilerException * @throws \Smarty\Exception */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting++; // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/src/Compile/Tag/SectionClose.php b/src/Compile/Tag/SectionClose.php index dee65bab3..efab60975 100644 --- a/src/Compile/Tag/SectionClose.php +++ b/src/Compile/Tag/SectionClose.php @@ -25,7 +25,8 @@ class SectionClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting--; [$openTag, $nocache_pushed] = $this->closeTag($compiler, ['section', 'sectionelse']); diff --git a/src/Compile/Tag/SectionElse.php b/src/Compile/Tag/SectionElse.php index be861e981..b9ea56366 100644 --- a/src/Compile/Tag/SectionElse.php +++ b/src/Compile/Tag/SectionElse.php @@ -20,7 +20,8 @@ class SectionElse extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { [$openTag, $nocache_pushed] = $this->closeTag($compiler, ['section']); $this->openTag($compiler, 'sectionelse', ['sectionelse', $nocache_pushed]); return ""; diff --git a/src/Compile/Tag/Setfilter.php b/src/Compile/Tag/Setfilter.php index 037a701e6..9da2f969c 100644 --- a/src/Compile/Tag/Setfilter.php +++ b/src/Compile/Tag/Setfilter.php @@ -21,7 +21,8 @@ class Setfilter extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->variable_filter_stack[] = $compiler->getSmarty()->getDefaultModifiers(); // The modifier_list is passed as an array of array's. The inner arrays have the modifier at index 0, @@ -34,8 +35,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = $compiler->getSmarty()->setDefaultModifiers($newList); - // this tag does not return compiled code - $compiler->has_code = false; - return true; + return ''; } } \ No newline at end of file diff --git a/src/Compile/Tag/SetfilterClose.php b/src/Compile/Tag/SetfilterClose.php index 273bb6fb0..2814f641d 100644 --- a/src/Compile/Tag/SetfilterClose.php +++ b/src/Compile/Tag/SetfilterClose.php @@ -29,7 +29,8 @@ class SetfilterClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->getAttributes($compiler, $args); // reset variable filter to previous state @@ -37,8 +38,6 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = count($compiler->variable_filter_stack) ? array_pop($compiler->variable_filter_stack) : [] ); - // this tag does not return compiled code - $compiler->has_code = false; - return true; + return ''; } } diff --git a/src/Compile/Tag/WhileClose.php b/src/Compile/Tag/WhileClose.php index 6c45cd720..5adb3a49b 100644 --- a/src/Compile/Tag/WhileClose.php +++ b/src/Compile/Tag/WhileClose.php @@ -28,7 +28,8 @@ class WhileClose extends Base { * * @return string compiled code */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting--; $nocache_pushed = $this->closeTag($compiler, ['while']); diff --git a/src/Compile/Tag/WhileTag.php b/src/Compile/Tag/WhileTag.php index 3df7d197f..3300b5075 100644 --- a/src/Compile/Tag/WhileTag.php +++ b/src/Compile/Tag/WhileTag.php @@ -22,7 +22,8 @@ class WhileTag extends Base { * @return string compiled code * @throws \Smarty\CompilerException */ - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $compiler->loopNesting++; if ($compiler->tag_nocache) { diff --git a/src/Compiler/Template.php b/src/Compiler/Template.php index db3c580d3..23984151c 100644 --- a/src/Compiler/Template.php +++ b/src/Compiler/Template.php @@ -184,13 +184,6 @@ class Template extends BaseCompiler { */ public $prefixCodeStack = []; - /** - * Tag has compiled code - * - * @var bool - */ - public $has_code = false; - /** * A variable string was compiled * @@ -1074,12 +1067,10 @@ public function cStyleComment($string) { } public function compileChildBlock() { - $this->has_code = true; return $this->blockCompiler->compileChild($this); } public function compileParentBlock() { - $this->has_code = true; return $this->blockCompiler->compileParent($this); } @@ -1096,8 +1087,6 @@ public function compileParentBlock() { */ private function compileTag2($tag, $args, $parameter) { // $args contains the attributes parsed and compiled by the lexer/parser - // assume that tag does compile into code, but creates no HTML output - $this->has_code = true; $this->handleNocacheFlag($args); @@ -1106,12 +1095,10 @@ private function compileTag2($tag, $args, $parameter) { if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) { $this->tag_nocache = $this->tag_nocache | !$tagCompiler->isCacheable(); $_output = $tagCompiler->compile($args, $this, $parameter); - if ($_output !== false) { - if (!empty($parameter['modifierlist'])) { - throw new CompilerException('No modifiers allowed on ' . $tag); - } - return $this->has_code && $_output !== true ? $_output : null; + if (!empty($parameter['modifierlist'])) { + throw new CompilerException('No modifiers allowed on ' . $tag); } + return $_output; } } @@ -1124,8 +1111,7 @@ private function compileTag2($tag, $args, $parameter) { $args['_attr']['name'] = "'{$tag}'"; $tagCompiler = $this->getTagCompiler('call'); - $_output = $tagCompiler === null ? false : $tagCompiler->compile($args, $this, $parameter); - return $this->has_code ? $_output : null; + return $tagCompiler === null ? false : $tagCompiler->compile($args, $this, $parameter); } // remaining tastes: (object-)function, (object-function-)block, custom-compiler diff --git a/src/Parser/TemplateParser.php b/src/Parser/TemplateParser.php index e55c1f034..58971b9c8 100644 --- a/src/Parser/TemplateParser.php +++ b/src/Parser/TemplateParser.php @@ -2134,13 +2134,11 @@ public function yy_r8(){ } // line 292 "src/Parser/TemplateParser.y" public function yy_r9(){ - if ($this->compiler->has_code) { - $this->current_buffer->append_subtree($this, $this->mergePrefixCode($this->yystack[$this->yyidx + 0]->minor)); - } + $this->current_buffer->append_subtree($this, $this->mergePrefixCode($this->yystack[$this->yyidx + 0]->minor)); $this->compiler->has_variable_string = false; $this->block_nesting_level = $this->compiler->getTagStackCount(); } -// line 304 "src/Parser/TemplateParser.y" +// line 302 "src/Parser/TemplateParser.y" public function yy_r11(){ $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); $attributes = []; @@ -2150,7 +2148,7 @@ public function yy_r11(){ } $this->_retvalue = $this->compiler->compilePrintExpression($this->compiler->compileVariable('\''.$var.'\''), $attributes); } -// line 315 "src/Parser/TemplateParser.y" +// line 313 "src/Parser/TemplateParser.y" public function yy_r12(){ $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); if ($tag == 'strip') { @@ -2171,7 +2169,7 @@ public function yy_r12(){ } } } -// line 336 "src/Parser/TemplateParser.y" +// line 334 "src/Parser/TemplateParser.y" public function yy_r13(){ $j = strrpos($this->yystack[$this->yyidx + 0]->minor,'.'); if ($this->yystack[$this->yyidx + 0]->minor[$j+1] == 'c') { @@ -2182,35 +2180,35 @@ public function yy_r13(){ $this->_retvalue = $this->compiler->compileParentBlock(); } } -// line 347 "src/Parser/TemplateParser.y" +// line 345 "src/Parser/TemplateParser.y" public function yy_r14(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 351 "src/Parser/TemplateParser.y" +// line 349 "src/Parser/TemplateParser.y" public function yy_r15(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 355 "src/Parser/TemplateParser.y" +// line 353 "src/Parser/TemplateParser.y" public function yy_r16(){ $this->_retvalue = $this->compiler->compilePrintExpression($this->yystack[$this->yyidx + 0]->minor[0], $this->yystack[$this->yyidx + 0]->minor[1]); } -// line 364 "src/Parser/TemplateParser.y" +// line 362 "src/Parser/TemplateParser.y" public function yy_r17(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'')),$this->yystack[$this->yyidx + 0]->minor[1])); } -// line 368 "src/Parser/TemplateParser.y" +// line 366 "src/Parser/TemplateParser.y" public function yy_r18(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>$this->yystack[$this->yyidx + -1]->minor['var'])),$this->yystack[$this->yyidx + 0]->minor[1]),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'])); } -// line 372 "src/Parser/TemplateParser.y" +// line 370 "src/Parser/TemplateParser.y" public function yy_r19(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 376 "src/Parser/TemplateParser.y" +// line 374 "src/Parser/TemplateParser.y" public function yy_r20(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } -// line 391 "src/Parser/TemplateParser.y" +// line 389 "src/Parser/TemplateParser.y" public function yy_r24(){ if (defined($this->yystack[$this->yyidx + -1]->minor)) { if ($this->security) { @@ -2221,7 +2219,7 @@ public function yy_r24(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } } -// line 401 "src/Parser/TemplateParser.y" +// line 399 "src/Parser/TemplateParser.y" public function yy_r25(){ if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { @@ -2232,7 +2230,7 @@ public function yy_r25(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor,array()); } } -// line 414 "src/Parser/TemplateParser.y" +// line 412 "src/Parser/TemplateParser.y" public function yy_r26(){ if (defined($this->yystack[$this->yyidx + -2]->minor)) { if ($this->security) { @@ -2243,66 +2241,66 @@ public function yy_r26(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + 0]->minor, array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); } } -// line 426 "src/Parser/TemplateParser.y" +// line 424 "src/Parser/TemplateParser.y" public function yy_r27(){ $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 431 "src/Parser/TemplateParser.y" +// line 429 "src/Parser/TemplateParser.y" public function yy_r28(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + 0]->minor,array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor, 'object_method'=>$this->yystack[$this->yyidx + -2]->minor)); } -// line 436 "src/Parser/TemplateParser.y" +// line 434 "src/Parser/TemplateParser.y" public function yy_r29(){ $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); } -// line 441 "src/Parser/TemplateParser.y" +// line 439 "src/Parser/TemplateParser.y" public function yy_r30(){ $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->compiler->getLdelLength())); $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 446 "src/Parser/TemplateParser.y" +// line 444 "src/Parser/TemplateParser.y" public function yy_r31(){ $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); } -// line 457 "src/Parser/TemplateParser.y" +// line 455 "src/Parser/TemplateParser.y" public function yy_r33(){ $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -4]->minor),array('var'=>$this->yystack[$this->yyidx + -2]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),1); } -// line 461 "src/Parser/TemplateParser.y" +// line 459 "src/Parser/TemplateParser.y" public function yy_r34(){ $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; } -// line 469 "src/Parser/TemplateParser.y" +// line 467 "src/Parser/TemplateParser.y" public function yy_r36(){ $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 473 "src/Parser/TemplateParser.y" +// line 471 "src/Parser/TemplateParser.y" public function yy_r37(){ $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 478 "src/Parser/TemplateParser.y" +// line 476 "src/Parser/TemplateParser.y" public function yy_r38(){ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -3]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor)))); } -// line 482 "src/Parser/TemplateParser.y" +// line 480 "src/Parser/TemplateParser.y" public function yy_r39(){ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor),array('key'=>$this->yystack[$this->yyidx + -3]->minor)))); } -// line 485 "src/Parser/TemplateParser.y" +// line 483 "src/Parser/TemplateParser.y" public function yy_r40(){ $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + 0]->minor); } -// line 490 "src/Parser/TemplateParser.y" +// line 488 "src/Parser/TemplateParser.y" public function yy_r41(){ $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 494 "src/Parser/TemplateParser.y" +// line 492 "src/Parser/TemplateParser.y" public function yy_r42(){ $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 500 "src/Parser/TemplateParser.y" +// line 498 "src/Parser/TemplateParser.y" public function yy_r43(){ $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' /'); if ($tag === 'strip') { @@ -2312,36 +2310,36 @@ public function yy_r43(){ $this->_retvalue = $this->compiler->compileTag($tag.'close',array()); } } -// line 509 "src/Parser/TemplateParser.y" +// line 507 "src/Parser/TemplateParser.y" public function yy_r44(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor.'close',array()); } -// line 513 "src/Parser/TemplateParser.y" +// line 511 "src/Parser/TemplateParser.y" public function yy_r45(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); } -// line 518 "src/Parser/TemplateParser.y" +// line 516 "src/Parser/TemplateParser.y" public function yy_r46(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('object_method'=>$this->yystack[$this->yyidx + 0]->minor)); } -// line 522 "src/Parser/TemplateParser.y" +// line 520 "src/Parser/TemplateParser.y" public function yy_r47(){ $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 530 "src/Parser/TemplateParser.y" +// line 528 "src/Parser/TemplateParser.y" public function yy_r48(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; } -// line 536 "src/Parser/TemplateParser.y" +// line 534 "src/Parser/TemplateParser.y" public function yy_r49(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } -// line 541 "src/Parser/TemplateParser.y" +// line 539 "src/Parser/TemplateParser.y" public function yy_r50(){ $this->_retvalue = array(); } -// line 546 "src/Parser/TemplateParser.y" +// line 544 "src/Parser/TemplateParser.y" public function yy_r51(){ if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { @@ -2352,108 +2350,108 @@ public function yy_r51(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'\''.$this->yystack[$this->yyidx + 0]->minor.'\''); } } -// line 557 "src/Parser/TemplateParser.y" +// line 555 "src/Parser/TemplateParser.y" public function yy_r52(){ $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); } -// line 565 "src/Parser/TemplateParser.y" +// line 563 "src/Parser/TemplateParser.y" public function yy_r54(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } -// line 577 "src/Parser/TemplateParser.y" +// line 575 "src/Parser/TemplateParser.y" public function yy_r57(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); } -// line 590 "src/Parser/TemplateParser.y" +// line 588 "src/Parser/TemplateParser.y" public function yy_r59(){ $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; } -// line 595 "src/Parser/TemplateParser.y" +// line 593 "src/Parser/TemplateParser.y" public function yy_r60(){ $this->_retvalue = array('var' => '\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'', 'value'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 602 "src/Parser/TemplateParser.y" +// line 600 "src/Parser/TemplateParser.y" public function yy_r62(){ $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 606 "src/Parser/TemplateParser.y" +// line 604 "src/Parser/TemplateParser.y" public function yy_r63(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 631 "src/Parser/TemplateParser.y" +// line 629 "src/Parser/TemplateParser.y" public function yy_r67(){ $this->_retvalue = '$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')->preIncDec(\'' . $this->yystack[$this->yyidx + -1]->minor . '\')'; } -// line 636 "src/Parser/TemplateParser.y" +// line 634 "src/Parser/TemplateParser.y" public function yy_r68(){ $this->_retvalue = '$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + -1]->minor,1) .'\')->postIncDec(\'' . $this->yystack[$this->yyidx + 0]->minor . '\')'; } -// line 641 "src/Parser/TemplateParser.y" +// line 639 "src/Parser/TemplateParser.y" public function yy_r69(){ $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'://' . $this->yystack[$this->yyidx + 0]->minor . '\')'; } -// line 646 "src/Parser/TemplateParser.y" +// line 644 "src/Parser/TemplateParser.y" public function yy_r70(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; } -// line 656 "src/Parser/TemplateParser.y" +// line 654 "src/Parser/TemplateParser.y" public function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor['pre']. $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor['op'].$this->yystack[$this->yyidx + 0]->minor .')'; } -// line 660 "src/Parser/TemplateParser.y" +// line 658 "src/Parser/TemplateParser.y" public function yy_r73(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 664 "src/Parser/TemplateParser.y" +// line 662 "src/Parser/TemplateParser.y" public function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor . $this->yystack[$this->yyidx + -1]->minor . ')'; } -// line 668 "src/Parser/TemplateParser.y" +// line 666 "src/Parser/TemplateParser.y" public function yy_r75(){ $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; } -// line 672 "src/Parser/TemplateParser.y" +// line 670 "src/Parser/TemplateParser.y" public function yy_r76(){ $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; } -// line 677 "src/Parser/TemplateParser.y" +// line 675 "src/Parser/TemplateParser.y" public function yy_r77(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?? '.$this->yystack[$this->yyidx + 0]->minor; } -// line 684 "src/Parser/TemplateParser.y" +// line 682 "src/Parser/TemplateParser.y" public function yy_r78(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; } -// line 688 "src/Parser/TemplateParser.y" +// line 686 "src/Parser/TemplateParser.y" public function yy_r79(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; } -// line 697 "src/Parser/TemplateParser.y" +// line 695 "src/Parser/TemplateParser.y" public function yy_r81(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?: '.$this->yystack[$this->yyidx + 0]->minor; } -// line 707 "src/Parser/TemplateParser.y" +// line 705 "src/Parser/TemplateParser.y" public function yy_r83(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 712 "src/Parser/TemplateParser.y" +// line 710 "src/Parser/TemplateParser.y" public function yy_r84(){ $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; } -// line 733 "src/Parser/TemplateParser.y" +// line 731 "src/Parser/TemplateParser.y" public function yy_r89(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 737 "src/Parser/TemplateParser.y" +// line 735 "src/Parser/TemplateParser.y" public function yy_r90(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; } -// line 741 "src/Parser/TemplateParser.y" +// line 739 "src/Parser/TemplateParser.y" public function yy_r91(){ $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 746 "src/Parser/TemplateParser.y" +// line 744 "src/Parser/TemplateParser.y" public function yy_r92(){ if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { @@ -2464,15 +2462,15 @@ public function yy_r92(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } } -// line 763 "src/Parser/TemplateParser.y" +// line 761 "src/Parser/TemplateParser.y" public function yy_r94(){ $this->_retvalue = '('. $this->yystack[$this->yyidx + -1]->minor .')'; } -// line 767 "src/Parser/TemplateParser.y" +// line 765 "src/Parser/TemplateParser.y" public function yy_r95(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 785 "src/Parser/TemplateParser.y" +// line 783 "src/Parser/TemplateParser.y" public function yy_r99(){ if ($this->security && $this->security->static_classes !== array()) { $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); @@ -2485,18 +2483,18 @@ public function yy_r99(){ } $this->_retvalue = $prefixVar .'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; } -// line 799 "src/Parser/TemplateParser.y" +// line 797 "src/Parser/TemplateParser.y" public function yy_r100(){ $prefixVar = $this->compiler->getNewPrefixVariable(); $tmp = $this->compiler->appendCode('', $this->yystack[$this->yyidx + 0]->minor); $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); $this->_retvalue = $prefixVar; } -// line 806 "src/Parser/TemplateParser.y" +// line 804 "src/Parser/TemplateParser.y" public function yy_r101(){ $this->_retvalue = $this->compiler->compileModifier($this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 819 "src/Parser/TemplateParser.y" +// line 817 "src/Parser/TemplateParser.y" public function yy_r104(){ if (!in_array(strtolower($this->yystack[$this->yyidx + -2]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) { if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { @@ -2508,15 +2506,15 @@ public function yy_r104(){ $this->compiler->trigger_template_error ('static class \''.$this->yystack[$this->yyidx + -2]->minor.'\' is undefined or not allowed by security setting'); } } -// line 838 "src/Parser/TemplateParser.y" +// line 836 "src/Parser/TemplateParser.y" public function yy_r106(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 849 "src/Parser/TemplateParser.y" +// line 847 "src/Parser/TemplateParser.y" public function yy_r107(){ $this->_retvalue = $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''); } -// line 852 "src/Parser/TemplateParser.y" +// line 850 "src/Parser/TemplateParser.y" public function yy_r108(){ if ($this->yystack[$this->yyidx + 0]->minor['var'] === '\'smarty\'') { $smarty_var = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); @@ -2528,104 +2526,104 @@ public function yy_r108(){ $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; } } -// line 865 "src/Parser/TemplateParser.y" +// line 863 "src/Parser/TemplateParser.y" public function yy_r109(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 875 "src/Parser/TemplateParser.y" +// line 873 "src/Parser/TemplateParser.y" public function yy_r111(){ $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -1]->minor . '\''); } -// line 879 "src/Parser/TemplateParser.y" +// line 877 "src/Parser/TemplateParser.y" public function yy_r112(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -2]->minor . '\'') . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; } -// line 883 "src/Parser/TemplateParser.y" +// line 881 "src/Parser/TemplateParser.y" public function yy_r113(){ $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -1]->minor); } -// line 887 "src/Parser/TemplateParser.y" +// line 885 "src/Parser/TemplateParser.y" public function yy_r114(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -2]->minor) . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; } -// line 891 "src/Parser/TemplateParser.y" +// line 889 "src/Parser/TemplateParser.y" public function yy_r115(){ $this->_retvalue = array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'', 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 894 "src/Parser/TemplateParser.y" +// line 892 "src/Parser/TemplateParser.y" public function yy_r116(){ $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 907 "src/Parser/TemplateParser.y" +// line 905 "src/Parser/TemplateParser.y" public function yy_r118(){ return; } -// line 913 "src/Parser/TemplateParser.y" +// line 911 "src/Parser/TemplateParser.y" public function yy_r119(){ $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\'').']'; } -// line 916 "src/Parser/TemplateParser.y" +// line 914 "src/Parser/TemplateParser.y" public function yy_r120(){ $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; } -// line 920 "src/Parser/TemplateParser.y" +// line 918 "src/Parser/TemplateParser.y" public function yy_r121(){ $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; } -// line 924 "src/Parser/TemplateParser.y" +// line 922 "src/Parser/TemplateParser.y" public function yy_r122(){ $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; } -// line 928 "src/Parser/TemplateParser.y" +// line 926 "src/Parser/TemplateParser.y" public function yy_r123(){ $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; } -// line 933 "src/Parser/TemplateParser.y" +// line 931 "src/Parser/TemplateParser.y" public function yy_r124(){ $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; } -// line 938 "src/Parser/TemplateParser.y" +// line 936 "src/Parser/TemplateParser.y" public function yy_r125(){ $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; } -// line 942 "src/Parser/TemplateParser.y" +// line 940 "src/Parser/TemplateParser.y" public function yy_r126(){ $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; } -// line 945 "src/Parser/TemplateParser.y" +// line 943 "src/Parser/TemplateParser.y" public function yy_r127(){ $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; } -// line 951 "src/Parser/TemplateParser.y" +// line 949 "src/Parser/TemplateParser.y" public function yy_r129(){ $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'').']'; } -// line 967 "src/Parser/TemplateParser.y" +// line 965 "src/Parser/TemplateParser.y" public function yy_r133(){ $this->_retvalue = '[]'; } -// line 977 "src/Parser/TemplateParser.y" +// line 975 "src/Parser/TemplateParser.y" public function yy_r134(){ $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; } -// line 981 "src/Parser/TemplateParser.y" +// line 979 "src/Parser/TemplateParser.y" public function yy_r135(){ $this->_retvalue = '\'\''; } -// line 986 "src/Parser/TemplateParser.y" +// line 984 "src/Parser/TemplateParser.y" public function yy_r136(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 994 "src/Parser/TemplateParser.y" +// line 992 "src/Parser/TemplateParser.y" public function yy_r138(){ $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); $this->_retvalue = $this->compiler->compileVariable('\''.$var.'\''); } -// line 1000 "src/Parser/TemplateParser.y" +// line 998 "src/Parser/TemplateParser.y" public function yy_r139(){ $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 1007 "src/Parser/TemplateParser.y" +// line 1005 "src/Parser/TemplateParser.y" public function yy_r140(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] === '\'smarty\'') { $this->_retvalue = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; @@ -2633,58 +2631,58 @@ public function yy_r140(){ $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; } } -// line 1016 "src/Parser/TemplateParser.y" +// line 1014 "src/Parser/TemplateParser.y" public function yy_r141(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 1021 "src/Parser/TemplateParser.y" +// line 1019 "src/Parser/TemplateParser.y" public function yy_r142(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1026 "src/Parser/TemplateParser.y" +// line 1024 "src/Parser/TemplateParser.y" public function yy_r143(){ if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1033 "src/Parser/TemplateParser.y" +// line 1031 "src/Parser/TemplateParser.y" public function yy_r144(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1040 "src/Parser/TemplateParser.y" +// line 1038 "src/Parser/TemplateParser.y" public function yy_r145(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1047 "src/Parser/TemplateParser.y" +// line 1045 "src/Parser/TemplateParser.y" public function yy_r146(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1055 "src/Parser/TemplateParser.y" +// line 1053 "src/Parser/TemplateParser.y" public function yy_r147(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1063 "src/Parser/TemplateParser.y" +// line 1061 "src/Parser/TemplateParser.y" public function yy_r148(){ $this->_retvalue = $this->compiler->compileModifierInExpression($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 1071 "src/Parser/TemplateParser.y" +// line 1069 "src/Parser/TemplateParser.y" public function yy_r149(){ if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . '('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1078 "src/Parser/TemplateParser.y" +// line 1076 "src/Parser/TemplateParser.y" public function yy_r150(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); @@ -2693,55 +2691,55 @@ public function yy_r150(){ $this->compiler->appendPrefixCode("compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -3]->minor,1).'\'').';?>'); $this->_retvalue = $prefixVar .'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1089 "src/Parser/TemplateParser.y" +// line 1087 "src/Parser/TemplateParser.y" public function yy_r151(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); } -// line 1106 "src/Parser/TemplateParser.y" +// line 1104 "src/Parser/TemplateParser.y" public function yy_r154(){ $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 1110 "src/Parser/TemplateParser.y" +// line 1108 "src/Parser/TemplateParser.y" public function yy_r155(){ $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); } -// line 1118 "src/Parser/TemplateParser.y" +// line 1116 "src/Parser/TemplateParser.y" public function yy_r157(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } -// line 1126 "src/Parser/TemplateParser.y" +// line 1124 "src/Parser/TemplateParser.y" public function yy_r158(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } -// line 1139 "src/Parser/TemplateParser.y" +// line 1137 "src/Parser/TemplateParser.y" public function yy_r161(){ $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); } -// line 1148 "src/Parser/TemplateParser.y" +// line 1146 "src/Parser/TemplateParser.y" public function yy_r163(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method'); } -// line 1153 "src/Parser/TemplateParser.y" +// line 1151 "src/Parser/TemplateParser.y" public function yy_r164(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method'); } -// line 1158 "src/Parser/TemplateParser.y" +// line 1156 "src/Parser/TemplateParser.y" public function yy_r165(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, ''); } -// line 1163 "src/Parser/TemplateParser.y" +// line 1161 "src/Parser/TemplateParser.y" public function yy_r166(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1168 "src/Parser/TemplateParser.y" +// line 1166 "src/Parser/TemplateParser.y" public function yy_r167(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1174 "src/Parser/TemplateParser.y" +// line 1172 "src/Parser/TemplateParser.y" public function yy_r168(){ $this->_retvalue = ' '. trim($this->yystack[$this->yyidx + 0]->minor) . ' '; } -// line 1178 "src/Parser/TemplateParser.y" +// line 1176 "src/Parser/TemplateParser.y" public function yy_r169(){ static $lops = array( 'eq' => ' == ', @@ -2761,7 +2759,7 @@ public function yy_r169(){ $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $lops[$op]; } -// line 1197 "src/Parser/TemplateParser.y" +// line 1195 "src/Parser/TemplateParser.y" public function yy_r170(){ static $tlops = array( 'isdivby' => array('op' => ' % ', 'pre' => '!('), @@ -2774,7 +2772,7 @@ public function yy_r170(){ $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $tlops[$op]; } -// line 1210 "src/Parser/TemplateParser.y" +// line 1208 "src/Parser/TemplateParser.y" public function yy_r171(){ static $scond = array ( 'iseven' => '!(1 & ', @@ -2785,53 +2783,53 @@ public function yy_r171(){ $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $scond[$op]; } -// line 1224 "src/Parser/TemplateParser.y" +// line 1222 "src/Parser/TemplateParser.y" public function yy_r172(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 1235 "src/Parser/TemplateParser.y" +// line 1233 "src/Parser/TemplateParser.y" public function yy_r175(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } -// line 1243 "src/Parser/TemplateParser.y" +// line 1241 "src/Parser/TemplateParser.y" public function yy_r177(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1247 "src/Parser/TemplateParser.y" +// line 1245 "src/Parser/TemplateParser.y" public function yy_r178(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1263 "src/Parser/TemplateParser.y" +// line 1261 "src/Parser/TemplateParser.y" public function yy_r181(){ $this->compiler->leaveDoubleQuote(); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php($this); } -// line 1269 "src/Parser/TemplateParser.y" +// line 1267 "src/Parser/TemplateParser.y" public function yy_r182(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 1274 "src/Parser/TemplateParser.y" +// line 1272 "src/Parser/TemplateParser.y" public function yy_r183(){ $this->_retvalue = new Dq($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1278 "src/Parser/TemplateParser.y" +// line 1276 "src/Parser/TemplateParser.y" public function yy_r184(){ $this->_retvalue = new Code('(string)'.$this->yystack[$this->yyidx + -1]->minor); } -// line 1282 "src/Parser/TemplateParser.y" +// line 1280 "src/Parser/TemplateParser.y" public function yy_r185(){ $this->_retvalue = new Code('(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); } -// line 1286 "src/Parser/TemplateParser.y" +// line 1284 "src/Parser/TemplateParser.y" public function yy_r186(){ $this->_retvalue = new Code('(string)$_smarty_tpl->getValue(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')'); } -// line 1298 "src/Parser/TemplateParser.y" +// line 1296 "src/Parser/TemplateParser.y" public function yy_r189(){ $this->_retvalue = new Tag($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1302 "src/Parser/TemplateParser.y" +// line 1300 "src/Parser/TemplateParser.y" public function yy_r190(){ $this->_retvalue = new DqContent($this->yystack[$this->yyidx + 0]->minor); } diff --git a/src/Parser/TemplateParser.y b/src/Parser/TemplateParser.y index 7305dcc81..68648196a 100644 --- a/src/Parser/TemplateParser.y +++ b/src/Parser/TemplateParser.y @@ -290,9 +290,7 @@ literal_e1(A) ::= . { } // Smarty tag template ::= template smartytag(B). { - if ($this->compiler->has_code) { - $this->current_buffer->append_subtree($this, $this->mergePrefixCode(B)); - } + $this->current_buffer->append_subtree($this, $this->mergePrefixCode(B)); $this->compiler->has_variable_string = false; $this->block_nesting_level = $this->compiler->getTagStackCount(); } diff --git a/tests/UnitTests/SecurityTests/SecurityTest.php b/tests/UnitTests/SecurityTests/SecurityTest.php index 5f896cc81..e2e66c965 100644 --- a/tests/UnitTests/SecurityTests/SecurityTest.php +++ b/tests/UnitTests/SecurityTests/SecurityTest.php @@ -303,7 +303,7 @@ public function testTemplateNotTrustedStream() } /** * - * + * @group slow */ public function testTrustedUri() { diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php index 1a0564eb2..3dc8c0a75 100644 --- a/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php +++ b/tests/UnitTests/SmartyMethodsTests/RegisterBlock/RegisterBlockTest.php @@ -304,7 +304,8 @@ class blockparamsCompiler extends \Smarty\Compile\Base { protected $shorttag_order = ["first", "second"]; protected $optional_attributes = ["first", "second"]; - public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, Template $compiler, $parameter = [], $tag = null, $function = null): string + { $_attr = $this->getAttributes($compiler, $args); $output = ''; diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.test.php b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.test.php index 13ca0dee7..8727d89f5 100644 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.test.php +++ b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.test.php @@ -6,7 +6,8 @@ class smarty_compiler_test extends Base { - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->required_attributes = array('data'); $_attr = $this->getAttributes($compiler, $args); diff --git a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.testclose.php b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.testclose.php index 68ab73f1d..c9b4c6152 100644 --- a/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.testclose.php +++ b/tests/UnitTests/TemplateSource/TagTests/CompilerPlugin/PHPunitplugins/compiler.testclose.php @@ -6,7 +6,8 @@ class smarty_compiler_testclose extends Base { - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $this->closeTag($compiler, 'test'); diff --git a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php index bece9d6d3..d9899e3c4 100644 --- a/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/PluginFunction/PluginFunctionFetchTest.php @@ -30,7 +30,7 @@ public function testInit() * test {fetch} from UIR * * -* +* @group slow */ public function testFetchUri() { diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index 3f13cb4cb..863ca6c41 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -32,7 +32,6 @@ public function testInit() * * @dataProvider functionProvider * test simple function call tag - * */ public function testSimpleFunction_001($text) { diff --git a/tests/UnitTests/__shared/PHPunitplugins/compiler.getparamsshort.php b/tests/UnitTests/__shared/PHPunitplugins/compiler.getparamsshort.php index 368b4a912..9fb80a894 100644 --- a/tests/UnitTests/__shared/PHPunitplugins/compiler.getparamsshort.php +++ b/tests/UnitTests/__shared/PHPunitplugins/compiler.getparamsshort.php @@ -41,8 +41,8 @@ class smarty_compiler_getparamsshort extends Base */ public $shorttag_order = array('s1', 's2', 's3'); - public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) - { + public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string + { $_attr = $this->getAttributes($compiler, $args); $output = ' $value) { From 578c03efa5f202f2ed84d0f48f82d5dfbd730fc4 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 25 Mar 2024 13:45:04 +0100 Subject: [PATCH 2/9] Deprecate stream variables (#933) --- docs/api/variables/streams.md | 3 +++ src/Template.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/api/variables/streams.md b/docs/api/variables/streams.md index 93d5c15e1..c872cf8bb 100644 --- a/docs/api/variables/streams.md +++ b/docs/api/variables/streams.md @@ -10,4 +10,7 @@ template. {$foo:bar} ``` +NB. Support for using streams to call variables is deprecated since Smarty v5.1 and will be removed +in a future version. + See also [`Template Resources`](../resources.md) diff --git a/src/Template.php b/src/Template.php index 0d66ff6e6..8bb5370f1 100644 --- a/src/Template.php +++ b/src/Template.php @@ -555,6 +555,9 @@ public function setRightDelimiter($right_delimiter) */ public function getStreamVariable($variable) { + + trigger_error("Using stream variables (\`\{\$foo:bar\}\`)is deprecated.", E_USER_DEPRECATED); + $_result = ''; $fp = fopen($variable, 'r+'); if ($fp) { From 58348c38ef24611d0fc7d17ce6a15c0dfbc600d8 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 25 Mar 2024 13:48:53 +0100 Subject: [PATCH 3/9] changelog entry for depcreated stream variables --- changelog/933.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/933.md diff --git a/changelog/933.md b/changelog/933.md new file mode 100644 index 000000000..7c6633cfc --- /dev/null +++ b/changelog/933.md @@ -0,0 +1 @@ +- Using stream variables in templates now throws a deprecation notice [#933](https://github.com/smarty-php/smarty/pull/933) From 1da30e76e835b2b8d0c8367fc3df0c5c5163688b Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 25 Mar 2024 13:54:02 +0100 Subject: [PATCH 4/9] Documented support for `is in`, added support for `is not in`. (#955) * Documented support for `is in`, added support for `is not in`. Fixes #937 * minor docs improvement --- changelog/937.md | 2 + .../language-syntax-operators.md | 24 + .../language-function-if.md | 28 +- .../language-function-while.md | 27 +- src/Lexer/TemplateLexer.php | 78 +- src/Lexer/TemplateLexer.plex | 2 +- src/Parser/TemplateParser.php | 1658 +++++++++-------- src/Parser/TemplateParser.y | 17 +- .../TagTests/If/CompileIfTest.php | 6 + 9 files changed, 943 insertions(+), 899 deletions(-) create mode 100644 changelog/937.md diff --git a/changelog/937.md b/changelog/937.md new file mode 100644 index 000000000..37f80e99a --- /dev/null +++ b/changelog/937.md @@ -0,0 +1,2 @@ +- Documented support for `{if $element is in $array}` syntax [#937](https://github.com/smarty-php/smarty/issues/937) +- Added support for `{if $element is not in $array}` syntax [#937](https://github.com/smarty-php/smarty/issues/937) \ No newline at end of file diff --git a/docs/designers/language-basic-syntax/language-syntax-operators.md b/docs/designers/language-basic-syntax/language-syntax-operators.md index 98eff0761..98a56538e 100644 --- a/docs/designers/language-basic-syntax/language-syntax-operators.md +++ b/docs/designers/language-basic-syntax/language-syntax-operators.md @@ -27,6 +27,30 @@ Various basic operators can be applied directly to variable values. > complex, it may be a good idea to move the bits that do not deal > explicitly with presentation to PHP by way of plugins or modifiers. +## List +The following is a list of recognized operators, which must be +separated from surrounding elements by spaces. Note that items listed in +\[brackets\] are optional. PHP equivalents are shown where applicable. + +| Operator | Alternates | Syntax Example | Meaning | PHP Equivalent | +|--------------------|------------|----------------------|--------------------------------|--------------------| +| == | eq | $a eq $b | equals | == | +| != | ne, neq | $a neq $b | not equals | != | +| > | gt | $a gt $b | greater than | > | +| < | lt | $a lt $b | less than | < | +| >= | gte, ge | $a ge $b | greater than or equal | >= | +| <= | lte, le | $a le $b | less than or equal | <= | +| === | | $a === 0 | check for identity | === | +| ! | not | not $a | negation (unary) | ! | +| % | mod | $a mod $b | modulo | % | +| is \[not\] div by | | $a is not div by 4 | divisible by | $a % $b == 0 | +| is \[not\] even | | $a is not even | \[not\] an even number (unary) | $a % 2 == 0 | +| is \[not\] even by | | $a is not even by $b | grouping level \[not\] even | ($a / $b) % 2 == 0 | +| is \[not\] odd | | $a is not odd | \[not\] an odd number (unary) | $a % 2 != 0 | +| is \[not\] odd by | | $a is not odd by $b | \[not\] an odd grouping | ($a / $b) % 2 != 0 | +| is in | | $a is in $b | exists in array | in_array($a, $b) | +| is \[not\] in | | $a is not in $b | does not exist in array | !in_array($a, $b) | + ## Ternary You can use the `?:` (or ternary) operator to test one expression and present the value of the second or third expression, based on the result of the test. diff --git a/docs/designers/language-builtin-functions/language-function-if.md b/docs/designers/language-builtin-functions/language-function-if.md index 1372ea588..eb00cfda3 100644 --- a/docs/designers/language-builtin-functions/language-function-if.md +++ b/docs/designers/language-builtin-functions/language-function-if.md @@ -3,32 +3,8 @@ `{if}` statements in Smarty have much the same flexibility as PHP [if](https://www.php.net/if) statements, with a few added features for the template engine. Every `{if}` must be paired with a matching `{/if}`. -`{else}` and `{elseif}` are also permitted. All PHP conditionals and -functions are recognized, such as *\|\|*, *or*, *&&*, *and*, -*is_array()*, etc. - -The following is a list of recognized qualifiers, which must be -separated from surrounding elements by spaces. Note that items listed in -\[brackets\] are optional. PHP equivalents are shown where applicable. - -## Qualifiers - -| Qualifier | Alternates | Syntax Example | Meaning | PHP Equivalent | -|--------------------|------------|----------------------|--------------------------------|--------------------| -| == | eq | $a eq $b | equals | == | -| != | ne, neq | $a neq $b | not equals | != | -| > | gt | $a gt $b | greater than | > | -| < | lt | $a lt $b | less than | < | -| >= | gte, ge | $a ge $b | greater than or equal | >= | -| <= | lte, le | $a le $b | less than or equal | <= | -| === | | $a === 0 | check for identity | === | -| ! | not | not $a | negation (unary) | ! | -| % | mod | $a mod $b | modulo | % | -| is \[not\] div by | | $a is not div by 4 | divisible by | $a % $b == 0 | -| is \[not\] even | | $a is not even | \[not\] an even number (unary) | $a % 2 == 0 | -| is \[not\] even by | | $a is not even by $b | grouping level \[not\] even | ($a / $b) % 2 == 0 | -| is \[not\] odd | | $a is not odd | \[not\] an odd number (unary) | $a % 2 != 0 | -| is \[not\] odd by | | $a is not odd by $b | \[not\] an odd grouping | ($a / $b) % 2 != 0 | +`{else}` and `{elseif}` are also permitted. All [operators](../language-basic-syntax/language-syntax-operators.md) are recognized, such as *==*, +*\|\|*, *or*, *&&*, *and*, etc and you can use modifiers as functions, such as *is_array()*. ## Examples ```smarty diff --git a/docs/designers/language-builtin-functions/language-function-while.md b/docs/designers/language-builtin-functions/language-function-while.md index 13eaef9b4..d0a4b2f3c 100644 --- a/docs/designers/language-builtin-functions/language-function-while.md +++ b/docs/designers/language-builtin-functions/language-function-while.md @@ -3,31 +3,8 @@ `{while}` loops in Smarty have much the same flexibility as PHP [while](https://www.php.net/while) statements, with a few added features for the template engine. Every `{while}` must be paired with a matching -`{/while}`. All PHP conditionals and functions are recognized, such as -*\|\|*, *or*, *&&*, *and*, *is_array()*, etc. - -The following is a list of recognized qualifiers, which must be -separated from surrounding elements by spaces. Note that items listed in -\[brackets\] are optional. PHP equivalents are shown where applicable. - -## Qualifiers - -| Qualifier | Alternates | Syntax Example | Meaning | PHP Equivalent | -|--------------------|------------|----------------------|--------------------------------|--------------------| -| == | eq | $a eq $b | equals | == | -| != | ne, neq | $a neq $b | not equals | != | -| > | gt | $a gt $b | greater than | > | -| < | lt | $a lt $b | less than | < | -| >= | gte, ge | $a ge $b | greater than or equal | >= | -| <= | lte, le | $a le $b | less than or equal | <= | -| === | | $a === 0 | check for identity | === | -| ! | not | not $a | negation (unary) | ! | -| % | mod | $a mod $b | modulo | % | -| is \[not\] div by | | $a is not div by 4 | divisible by | $a % $b == 0 | -| is \[not\] even | | $a is not even | \[not\] an even number (unary) | $a % 2 == 0 | -| is \[not\] even by | | $a is not even by $b | grouping level \[not\] even | ($a / $b) % 2 == 0 | -| is \[not\] odd | | $a is not odd | \[not\] an odd number (unary) | $a % 2 != 0 | -| is \[not\] odd by | | $a is not odd by $b | \[not\] an odd grouping | ($a / $b) % 2 != 0 | +`{/while}`. All [operators](../language-basic-syntax/language-syntax-operators.md) are recognized, such as *==*, +*\|\|*, *or*, *&&*, *and*, etc and you can use modifiers as functions, such as *is_array()*. ## Examples ```smarty diff --git a/src/Lexer/TemplateLexer.php b/src/Lexer/TemplateLexer.php index 5c7253ba7..2e7f33055 100644 --- a/src/Lexer/TemplateLexer.php +++ b/src/Lexer/TemplateLexer.php @@ -567,7 +567,7 @@ public function yy_r2_23() public function yylex3() { if (!isset($this->yy_global_pattern3)) { - $this->yy_global_pattern3 = $this->replace("/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); + $this->yy_global_pattern3 = $this->replace("/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+(not\\s+)?in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -659,122 +659,122 @@ public function yy_r3_8() $this->token = \Smarty\Parser\TemplateParser::TP_ISIN; } - public function yy_r3_9() + public function yy_r3_10() { $this->token = \Smarty\Parser\TemplateParser::TP_AS; } - public function yy_r3_10() + public function yy_r3_11() { $this->token = \Smarty\Parser\TemplateParser::TP_TO; } - public function yy_r3_11() + public function yy_r3_12() { $this->token = \Smarty\Parser\TemplateParser::TP_STEP; } - public function yy_r3_12() + public function yy_r3_13() { $this->token = \Smarty\Parser\TemplateParser::TP_INSTANCEOF; } - public function yy_r3_13() + public function yy_r3_14() { $this->token = \Smarty\Parser\TemplateParser::TP_LOGOP; } - public function yy_r3_15() + public function yy_r3_16() { $this->token = \Smarty\Parser\TemplateParser::TP_SLOGOP; } - public function yy_r3_17() + public function yy_r3_18() { $this->token = \Smarty\Parser\TemplateParser::TP_TLOGOP; } - public function yy_r3_20() + public function yy_r3_21() { $this->token = \Smarty\Parser\TemplateParser::TP_SINGLECOND; } - public function yy_r3_23() + public function yy_r3_24() { $this->token = \Smarty\Parser\TemplateParser::TP_NOT; } - public function yy_r3_24() + public function yy_r3_25() { $this->token = \Smarty\Parser\TemplateParser::TP_TYPECAST; } - public function yy_r3_28() + public function yy_r3_29() { $this->token = \Smarty\Parser\TemplateParser::TP_OPENP; } - public function yy_r3_29() + public function yy_r3_30() { $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEP; } - public function yy_r3_30() + public function yy_r3_31() { $this->token = \Smarty\Parser\TemplateParser::TP_OPENB; } - public function yy_r3_31() + public function yy_r3_32() { $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEB; } - public function yy_r3_32() + public function yy_r3_33() { $this->token = \Smarty\Parser\TemplateParser::TP_PTR; } - public function yy_r3_33() + public function yy_r3_34() { $this->token = \Smarty\Parser\TemplateParser::TP_APTR; } - public function yy_r3_34() + public function yy_r3_35() { $this->token = \Smarty\Parser\TemplateParser::TP_EQUAL; } - public function yy_r3_35() + public function yy_r3_36() { $this->token = \Smarty\Parser\TemplateParser::TP_INCDEC; } - public function yy_r3_37() + public function yy_r3_38() { $this->token = \Smarty\Parser\TemplateParser::TP_UNIMATH; } - public function yy_r3_39() + public function yy_r3_40() { $this->token = \Smarty\Parser\TemplateParser::TP_MATH; } - public function yy_r3_41() + public function yy_r3_42() { $this->token = \Smarty\Parser\TemplateParser::TP_AT; } - public function yy_r3_42() + public function yy_r3_43() { $this->token = \Smarty\Parser\TemplateParser::TP_ARRAYOPEN; } - public function yy_r3_43() + public function yy_r3_44() { $this->token = \Smarty\Parser\TemplateParser::TP_HATCH; } - public function yy_r3_44() + public function yy_r3_45() { // resolve conflicts with shorttag and right_delimiter starting with '=' @@ -786,73 +786,73 @@ public function yy_r3_44() $this->token = \Smarty\Parser\TemplateParser::TP_ATTR; } } - public function yy_r3_45() + public function yy_r3_46() { $this->token = \Smarty\Parser\TemplateParser::TP_NAMESPACE; } - public function yy_r3_48() + public function yy_r3_49() { $this->token = \Smarty\Parser\TemplateParser::TP_ID; } - public function yy_r3_49() + public function yy_r3_50() { $this->token = \Smarty\Parser\TemplateParser::TP_INTEGER; } - public function yy_r3_50() + public function yy_r3_51() { $this->token = \Smarty\Parser\TemplateParser::TP_BACKTICK; $this->yypopstate(); } - public function yy_r3_51() + public function yy_r3_52() { $this->token = \Smarty\Parser\TemplateParser::TP_VERT; } - public function yy_r3_52() + public function yy_r3_53() { $this->token = \Smarty\Parser\TemplateParser::TP_DOT; } - public function yy_r3_53() + public function yy_r3_54() { $this->token = \Smarty\Parser\TemplateParser::TP_COMMA; } - public function yy_r3_54() + public function yy_r3_55() { $this->token = \Smarty\Parser\TemplateParser::TP_SEMICOLON; } - public function yy_r3_55() + public function yy_r3_56() { $this->token = \Smarty\Parser\TemplateParser::TP_DOUBLECOLON; } - public function yy_r3_56() + public function yy_r3_57() { $this->token = \Smarty\Parser\TemplateParser::TP_COLON; } - public function yy_r3_57() + public function yy_r3_58() { $this->token = \Smarty\Parser\TemplateParser::TP_QMARK; } - public function yy_r3_58() + public function yy_r3_59() { $this->token = \Smarty\Parser\TemplateParser::TP_HEX; } - public function yy_r3_59() + public function yy_r3_60() { $this->token = \Smarty\Parser\TemplateParser::TP_SPACE; } - public function yy_r3_60() + public function yy_r3_61() { $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; diff --git a/src/Lexer/TemplateLexer.plex b/src/Lexer/TemplateLexer.plex index d29b65597..282a99cf9 100644 --- a/src/Lexer/TemplateLexer.plex +++ b/src/Lexer/TemplateLexer.plex @@ -324,7 +324,7 @@ class TemplateLexer slop = ~\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\s+~ tlop = ~\s+is\s+(not\s+)?(odd|even|div)\s+by\s+~ scond = ~\s+is\s+(not\s+)?(odd|even)~ - isin = ~\s+is\s+in\s+~ + isin = ~\s+is\s+(not\s+)?in\s+~ as = ~\s+as\s+~ to = ~\s+to\s+~ step = ~\s+step\s+~ diff --git a/src/Parser/TemplateParser.php b/src/Parser/TemplateParser.php index 58971b9c8..12d9b6c5a 100644 --- a/src/Parser/TemplateParser.php +++ b/src/Parser/TemplateParser.php @@ -263,505 +263,541 @@ private function mergePrefixCode($code) const TP_ARRAYOPEN = 57; const TP_QUOTE = 58; const TP_BACKTICK = 59; - const YY_NO_ACTION = 525; - const YY_ACCEPT_ACTION = 524; - const YY_ERROR_ACTION = 523; + const YY_NO_ACTION = 527; + const YY_ACCEPT_ACTION = 526; + const YY_ERROR_ACTION = 525; - const YY_SZ_ACTTAB = 2191; + const YY_SZ_ACTTAB = 2372; public static $yy_action = array( - 33, 126, 524, 96, 261, 279, 437, 242, 243, 244, - 1, 98, 135, 127, 199, 228, 6, 55, 437, 217, - 197, 260, 109, 317, 392, 292, 212, 256, 213, 103, - 219, 392, 21, 392, 99, 43, 392, 32, 44, 45, - 273, 221, 392, 277, 392, 200, 392, 54, 4, 313, - 294, 46, 22, 280, 220, 5, 52, 242, 243, 244, - 1, 20, 132, 189, 190, 266, 6, 55, 241, 217, - 211, 29, 109, 224, 9, 156, 212, 256, 213, 493, - 205, 267, 21, 252, 264, 43, 176, 297, 44, 45, - 273, 221, 312, 230, 306, 200, 211, 54, 4, 320, - 294, 294, 3, 248, 99, 5, 52, 242, 243, 244, - 1, 294, 97, 386, 53, 231, 6, 55, 36, 217, - 99, 150, 109, 252, 16, 386, 212, 256, 213, 149, - 219, 386, 21, 112, 437, 43, 302, 93, 44, 45, - 273, 221, 306, 277, 211, 200, 437, 54, 4, 112, - 294, 197, 39, 99, 140, 5, 52, 242, 243, 244, - 1, 136, 134, 262, 199, 28, 6, 55, 155, 217, - 252, 151, 109, 99, 94, 91, 212, 256, 213, 137, - 219, 251, 21, 57, 308, 43, 13, 7, 44, 45, - 273, 221, 294, 277, 263, 200, 54, 54, 4, 294, - 294, 181, 112, 298, 197, 5, 52, 242, 243, 244, - 1, 259, 134, 232, 191, 353, 6, 55, 26, 217, - 330, 353, 109, 104, 149, 437, 212, 256, 213, 174, - 219, 222, 21, 250, 51, 43, 141, 437, 44, 45, - 273, 221, 232, 277, 296, 200, 251, 54, 4, 233, - 294, 35, 104, 353, 285, 5, 52, 242, 243, 244, - 1, 259, 133, 138, 199, 353, 6, 55, 108, 217, - 173, 353, 109, 175, 297, 14, 212, 256, 213, 450, - 219, 15, 11, 264, 51, 43, 450, 139, 44, 45, - 273, 221, 144, 277, 152, 200, 181, 54, 4, 136, - 294, 226, 251, 154, 251, 5, 52, 242, 243, 244, - 1, 146, 134, 251, 186, 197, 6, 55, 170, 217, - 157, 251, 109, 17, 180, 294, 212, 256, 213, 329, - 208, 215, 21, 180, 54, 43, 252, 294, 44, 45, - 273, 221, 143, 277, 181, 200, 254, 54, 4, 19, - 294, 126, 104, 253, 227, 5, 52, 242, 243, 244, - 1, 98, 134, 259, 184, 161, 6, 55, 178, 217, - 240, 148, 109, 175, 297, 292, 212, 256, 213, 284, - 219, 251, 21, 197, 23, 43, 51, 127, 44, 45, - 273, 221, 164, 277, 168, 200, 252, 54, 4, 171, - 294, 304, 251, 197, 327, 5, 52, 242, 243, 244, - 1, 137, 134, 167, 199, 180, 6, 55, 13, 217, - 181, 255, 109, 251, 87, 181, 212, 256, 213, 25, - 185, 18, 21, 177, 297, 43, 88, 15, 44, 45, - 273, 221, 294, 277, 24, 200, 295, 54, 4, 258, - 294, 41, 42, 40, 12, 5, 52, 242, 243, 244, - 1, 163, 136, 437, 199, 39, 6, 55, 287, 288, - 289, 290, 109, 259, 303, 437, 212, 256, 213, 450, - 219, 214, 21, 209, 194, 47, 450, 438, 44, 45, - 273, 221, 9, 277, 309, 200, 51, 54, 4, 438, - 294, 41, 42, 40, 12, 5, 52, 242, 243, 244, - 1, 10, 136, 24, 199, 321, 6, 55, 287, 288, - 289, 290, 109, 113, 239, 240, 212, 256, 213, 220, - 219, 255, 21, 8, 24, 43, 322, 316, 44, 45, - 273, 221, 89, 277, 293, 200, 195, 54, 4, 95, - 294, 34, 169, 172, 238, 5, 52, 282, 210, 211, - 247, 232, 90, 106, 158, 188, 100, 86, 234, 196, - 254, 104, 98, 19, 153, 268, 269, 253, 92, 220, - 159, 276, 201, 278, 251, 283, 292, 245, 282, 210, - 211, 247, 466, 90, 106, 466, 187, 100, 63, 466, - 246, 179, 110, 98, 181, 165, 268, 269, 257, 223, - 118, 265, 276, 201, 278, 251, 283, 292, 46, 22, - 280, 282, 270, 211, 249, 272, 111, 106, 274, 188, - 100, 86, 220, 282, 275, 211, 98, 259, 111, 268, - 269, 198, 116, 75, 7, 276, 201, 278, 98, 283, - 292, 268, 269, 145, 291, 56, 160, 276, 201, 278, - 51, 283, 292, 41, 42, 40, 12, 315, 162, 282, - 229, 211, 204, 311, 111, 318, 197, 198, 116, 75, - 287, 288, 289, 290, 98, 319, 36, 268, 269, 197, - 328, 331, 301, 276, 201, 278, 301, 283, 292, 37, - 14, 357, 282, 301, 211, 225, 15, 105, 203, 311, - 198, 119, 49, 14, 117, 301, 301, 98, 301, 15, - 268, 269, 437, 301, 301, 301, 276, 201, 278, 301, - 283, 292, 301, 301, 437, 282, 301, 211, 301, 301, - 111, 301, 301, 198, 119, 70, 301, 301, 301, 301, - 98, 301, 142, 268, 269, 301, 301, 301, 301, 276, - 201, 278, 251, 283, 292, 46, 22, 280, 282, 301, - 211, 207, 301, 111, 301, 301, 198, 119, 70, 301, - 301, 301, 301, 98, 301, 166, 268, 269, 301, 301, - 301, 301, 276, 201, 278, 251, 283, 292, 46, 22, - 280, 282, 301, 211, 202, 301, 111, 301, 301, 198, - 116, 75, 301, 301, 301, 301, 98, 301, 301, 268, - 269, 197, 301, 301, 301, 276, 201, 278, 301, 283, - 292, 301, 301, 354, 282, 301, 211, 301, 301, 111, - 301, 310, 198, 119, 70, 354, 301, 301, 301, 98, - 301, 354, 268, 269, 197, 301, 301, 301, 276, 201, - 278, 301, 283, 292, 301, 301, 388, 282, 301, 211, - 206, 301, 105, 301, 301, 198, 119, 61, 388, 233, - 301, 301, 98, 301, 388, 268, 269, 197, 301, 301, - 301, 276, 201, 278, 301, 283, 292, 301, 301, 385, - 282, 301, 211, 301, 301, 111, 301, 301, 198, 115, - 67, 385, 301, 301, 301, 98, 301, 385, 268, 269, - 301, 301, 301, 301, 276, 201, 278, 254, 283, 292, - 19, 301, 301, 282, 253, 211, 301, 466, 111, 301, - 466, 193, 114, 62, 466, 282, 301, 211, 98, 301, - 111, 268, 269, 198, 101, 85, 301, 276, 201, 278, - 98, 283, 292, 268, 269, 254, 216, 301, 19, 276, - 201, 278, 253, 283, 292, 282, 466, 211, 301, 301, - 111, 14, 301, 198, 102, 84, 301, 15, 301, 301, - 98, 301, 301, 268, 269, 301, 301, 301, 301, 276, - 201, 278, 301, 283, 292, 301, 301, 282, 301, 211, - 301, 301, 111, 301, 301, 198, 119, 58, 301, 282, - 301, 211, 98, 301, 111, 268, 269, 198, 119, 69, - 301, 276, 201, 278, 98, 283, 292, 268, 269, 301, - 301, 301, 301, 276, 201, 278, 301, 283, 292, 282, - 301, 211, 301, 301, 111, 301, 301, 198, 101, 59, - 301, 301, 301, 301, 98, 301, 301, 268, 269, 301, - 301, 301, 301, 276, 201, 278, 301, 283, 292, 301, - 301, 282, 301, 211, 301, 301, 111, 301, 301, 198, - 119, 68, 301, 282, 301, 211, 98, 301, 111, 268, - 269, 198, 119, 60, 301, 276, 201, 278, 98, 283, - 292, 268, 269, 301, 301, 301, 301, 276, 201, 278, - 301, 283, 292, 282, 301, 211, 301, 301, 111, 301, - 301, 198, 119, 61, 301, 301, 301, 301, 98, 301, - 301, 268, 269, 301, 301, 301, 301, 276, 201, 278, - 301, 283, 292, 301, 301, 282, 301, 211, 301, 301, - 111, 301, 301, 198, 119, 71, 301, 282, 301, 211, - 98, 301, 111, 268, 269, 198, 119, 72, 301, 276, - 201, 278, 98, 283, 292, 268, 269, 301, 301, 301, - 301, 276, 201, 278, 301, 283, 292, 282, 301, 211, - 301, 301, 111, 301, 301, 198, 119, 73, 301, 301, - 301, 301, 98, 301, 301, 268, 269, 301, 301, 301, - 301, 276, 201, 278, 301, 283, 292, 301, 301, 282, - 301, 211, 301, 301, 111, 301, 301, 198, 119, 74, - 301, 282, 301, 211, 98, 301, 111, 268, 269, 198, - 119, 76, 301, 276, 201, 278, 98, 283, 292, 268, - 269, 301, 301, 301, 301, 276, 201, 278, 301, 283, - 292, 282, 301, 211, 301, 301, 111, 301, 301, 192, - 119, 64, 301, 301, 301, 301, 98, 301, 301, 268, - 269, 301, 301, 301, 301, 276, 201, 278, 301, 283, - 292, 301, 301, 282, 301, 211, 301, 301, 111, 301, - 301, 198, 119, 65, 301, 282, 301, 211, 98, 301, - 111, 268, 269, 198, 119, 66, 301, 276, 201, 278, - 98, 283, 292, 268, 269, 301, 301, 301, 301, 276, - 201, 278, 301, 283, 292, 282, 301, 211, 301, 301, - 111, 301, 301, 198, 119, 77, 301, 301, 301, 301, - 98, 301, 301, 268, 269, 301, 301, 301, 301, 276, - 201, 278, 301, 283, 292, 301, 301, 282, 301, 211, - 301, 301, 111, 301, 301, 198, 119, 78, 301, 282, - 301, 211, 98, 301, 111, 268, 269, 198, 119, 79, - 301, 276, 201, 278, 98, 283, 292, 268, 269, 301, - 301, 301, 301, 276, 201, 278, 301, 283, 292, 282, - 301, 211, 301, 301, 111, 301, 301, 198, 119, 80, - 301, 301, 301, 301, 98, 301, 301, 268, 269, 301, - 301, 301, 301, 276, 201, 278, 301, 283, 292, 301, - 301, 282, 301, 211, 301, 301, 111, 301, 301, 198, - 119, 81, 301, 282, 301, 211, 98, 301, 111, 268, - 269, 198, 119, 82, 301, 276, 201, 278, 98, 283, - 292, 268, 269, 301, 301, 301, 301, 276, 201, 278, - 301, 283, 292, 282, 301, 211, 301, 301, 111, 301, - 301, 198, 119, 83, 301, 301, 301, 301, 98, 301, - 301, 268, 269, 301, 301, 301, 301, 276, 201, 278, - 301, 283, 292, 301, 301, 282, 301, 211, 301, 301, - 111, 301, 301, 198, 119, 48, 301, 282, 301, 211, - 98, 301, 111, 268, 269, 198, 119, 50, 301, 276, - 201, 278, 98, 283, 292, 268, 269, 301, 301, 301, - 301, 276, 201, 278, 301, 283, 292, 307, 107, 301, - 301, 301, 301, 242, 243, 244, 2, 301, 305, 301, - 301, 301, 6, 55, 41, 42, 40, 12, 109, 301, - 301, 301, 212, 256, 213, 301, 301, 38, 301, 14, - 301, 287, 288, 289, 290, 15, 301, 301, 301, 301, - 41, 42, 40, 12, 301, 301, 301, 301, 301, 301, - 301, 301, 300, 27, 301, 301, 307, 287, 288, 289, - 290, 301, 242, 243, 244, 2, 301, 305, 301, 301, - 301, 6, 55, 301, 301, 301, 301, 109, 301, 14, - 301, 212, 256, 213, 301, 15, 301, 301, 301, 301, - 41, 42, 40, 12, 301, 301, 301, 301, 301, 301, - 301, 301, 301, 301, 301, 301, 301, 287, 288, 289, - 290, 301, 27, 301, 301, 235, 236, 237, 130, 301, - 301, 242, 243, 244, 1, 301, 301, 301, 301, 301, - 6, 55, 301, 301, 301, 301, 109, 301, 301, 301, - 212, 256, 213, 282, 301, 211, 301, 301, 111, 301, - 301, 198, 131, 301, 301, 301, 301, 301, 98, 301, - 301, 301, 301, 301, 301, 301, 325, 276, 201, 278, - 301, 283, 292, 301, 301, 301, 301, 301, 282, 301, - 211, 301, 301, 111, 301, 301, 198, 125, 301, 301, - 282, 301, 211, 98, 301, 111, 301, 301, 198, 129, - 301, 281, 276, 201, 278, 98, 283, 292, 301, 301, - 301, 301, 301, 301, 276, 201, 278, 301, 283, 292, - 301, 301, 301, 301, 282, 301, 211, 301, 301, 111, - 301, 301, 198, 120, 301, 301, 301, 301, 301, 98, - 301, 301, 301, 301, 301, 301, 301, 301, 276, 201, - 278, 301, 283, 292, 301, 301, 282, 301, 211, 301, - 301, 111, 301, 301, 198, 121, 301, 301, 282, 301, - 211, 98, 301, 111, 301, 301, 198, 122, 301, 301, - 276, 201, 278, 98, 283, 292, 301, 301, 301, 301, - 301, 301, 276, 201, 278, 301, 283, 292, 282, 301, - 211, 301, 301, 111, 301, 301, 198, 123, 301, 301, - 301, 301, 301, 98, 301, 301, 301, 301, 301, 301, - 301, 301, 276, 201, 278, 301, 283, 292, 301, 301, - 282, 301, 211, 301, 301, 111, 301, 301, 198, 124, - 301, 301, 282, 301, 211, 98, 301, 111, 301, 301, - 198, 128, 301, 301, 276, 201, 278, 98, 283, 292, - 301, 301, 218, 301, 301, 301, 276, 201, 278, 466, - 283, 292, 466, 218, 301, 3, 466, 450, 301, 301, - 466, 271, 301, 466, 301, 301, 218, 466, 450, 301, - 301, 254, 271, 466, 19, 301, 466, 301, 253, 35, - 466, 450, 301, 450, 401, 271, 450, 14, 466, 147, - 450, 301, 301, 15, 450, 301, 301, 450, 301, 466, - 301, 450, 286, 301, 301, 301, 301, 450, 301, 301, - 450, 301, 466, 301, 450, 218, 437, 301, 401, 401, - 401, 401, 466, 301, 301, 466, 301, 301, 437, 466, - 450, 301, 30, 301, 271, 401, 401, 401, 401, 466, - 301, 301, 466, 301, 324, 301, 466, 450, 301, 301, - 301, 271, 301, 301, 301, 301, 450, 301, 301, 450, - 301, 466, 301, 450, 301, 301, 301, 41, 42, 40, - 12, 301, 301, 450, 301, 299, 450, 301, 466, 301, - 450, 301, 301, 301, 287, 288, 289, 290, 41, 42, - 40, 12, 323, 41, 42, 40, 12, 301, 41, 42, - 40, 12, 182, 314, 31, 287, 288, 289, 290, 183, - 287, 288, 289, 290, 301, 287, 288, 289, 290, 301, - 301, 301, 301, 301, 301, 41, 42, 40, 12, 301, - 301, 301, 41, 42, 40, 12, 301, 301, 41, 42, - 40, 12, 287, 288, 289, 290, 326, 301, 301, 287, - 288, 289, 290, 301, 301, 287, 288, 289, 290, 466, - 301, 301, 466, 301, 301, 301, 466, 450, 301, 41, - 42, 40, 12, 301, 301, 301, 301, 301, 301, 301, - 301, 301, 301, 301, 301, 301, 287, 288, 289, 290, - 301, 301, 301, 450, 301, 301, 450, 301, 466, 301, - 450, + 33, 197, 264, 299, 176, 298, 259, 242, 243, 244, + 1, 259, 135, 232, 199, 354, 6, 84, 495, 217, + 331, 354, 109, 104, 393, 248, 212, 256, 213, 51, + 219, 393, 21, 393, 51, 43, 393, 32, 44, 45, + 273, 221, 393, 277, 393, 200, 393, 83, 4, 136, + 295, 226, 149, 99, 220, 5, 52, 242, 243, 244, + 1, 307, 132, 211, 190, 9, 6, 84, 241, 217, + 211, 126, 109, 150, 261, 252, 212, 256, 213, 137, + 205, 98, 21, 313, 83, 43, 13, 295, 44, 45, + 273, 221, 260, 230, 197, 200, 293, 83, 4, 321, + 295, 35, 149, 86, 309, 5, 52, 242, 243, 244, + 1, 146, 97, 387, 82, 231, 6, 84, 14, 217, + 138, 251, 109, 148, 15, 387, 212, 256, 213, 452, + 219, 387, 21, 251, 439, 43, 452, 252, 44, 45, + 273, 221, 3, 277, 99, 200, 439, 83, 4, 252, + 295, 259, 526, 96, 252, 5, 52, 242, 243, 244, + 1, 136, 134, 262, 199, 103, 6, 84, 155, 217, + 252, 279, 109, 112, 51, 439, 212, 256, 213, 127, + 219, 316, 21, 99, 228, 43, 314, 439, 44, 45, + 273, 221, 318, 277, 263, 200, 83, 83, 4, 295, + 295, 46, 22, 280, 40, 5, 52, 242, 243, 244, + 1, 20, 134, 189, 191, 266, 6, 84, 254, 217, + 250, 19, 109, 152, 141, 253, 212, 256, 213, 197, + 219, 267, 21, 251, 251, 43, 175, 298, 44, 45, + 273, 221, 151, 277, 108, 200, 91, 83, 4, 87, + 295, 295, 251, 354, 180, 5, 52, 242, 243, 244, + 1, 259, 133, 140, 199, 354, 6, 84, 307, 217, + 211, 354, 109, 181, 197, 39, 212, 256, 213, 286, + 219, 14, 11, 94, 51, 43, 88, 15, 44, 45, + 273, 221, 153, 277, 143, 200, 92, 83, 4, 139, + 295, 295, 251, 154, 104, 5, 52, 242, 243, 244, + 1, 303, 134, 251, 186, 173, 6, 84, 36, 217, + 99, 126, 109, 181, 227, 285, 212, 256, 213, 137, + 208, 98, 21, 127, 180, 43, 13, 295, 44, 45, + 273, 221, 181, 277, 232, 200, 293, 83, 4, 112, + 295, 234, 196, 297, 104, 5, 52, 242, 243, 244, + 1, 29, 134, 224, 184, 156, 6, 84, 468, 217, + 197, 468, 109, 197, 23, 468, 212, 256, 213, 264, + 219, 18, 21, 175, 298, 43, 215, 15, 44, 45, + 273, 221, 232, 277, 170, 200, 168, 83, 4, 233, + 295, 295, 104, 144, 99, 5, 52, 242, 243, 244, + 1, 259, 134, 251, 199, 157, 6, 84, 26, 217, + 161, 181, 109, 181, 255, 439, 212, 256, 213, 178, + 185, 240, 21, 112, 51, 43, 164, 439, 44, 45, + 273, 221, 174, 277, 222, 200, 251, 83, 4, 305, + 295, 41, 42, 281, 12, 5, 52, 242, 243, 244, + 1, 197, 136, 163, 199, 167, 6, 84, 288, 289, + 290, 291, 109, 17, 304, 251, 212, 256, 213, 330, + 219, 16, 21, 258, 171, 47, 180, 25, 44, 45, + 273, 221, 39, 277, 93, 200, 255, 83, 4, 328, + 295, 41, 42, 281, 12, 5, 52, 242, 243, 244, + 1, 181, 136, 439, 199, 214, 6, 84, 288, 289, + 290, 291, 109, 177, 298, 439, 212, 256, 213, 28, + 219, 8, 21, 209, 194, 43, 89, 295, 44, 45, + 273, 221, 452, 277, 24, 200, 296, 83, 4, 452, + 295, 7, 440, 239, 240, 5, 52, 283, 210, 211, + 247, 95, 90, 106, 440, 188, 100, 81, 10, 9, + 254, 310, 98, 19, 294, 268, 269, 253, 195, 158, + 113, 169, 276, 201, 278, 172, 284, 293, 283, 210, + 211, 247, 197, 90, 106, 238, 187, 100, 58, 24, + 34, 322, 220, 98, 358, 159, 268, 269, 225, 223, + 317, 245, 179, 276, 201, 278, 14, 284, 293, 246, + 110, 283, 15, 211, 249, 439, 111, 106, 220, 188, + 100, 81, 24, 257, 323, 254, 98, 439, 19, 268, + 269, 118, 253, 265, 270, 272, 276, 201, 278, 7, + 284, 293, 283, 220, 211, 274, 292, 111, 85, 229, + 198, 116, 70, 275, 319, 160, 329, 98, 162, 320, + 268, 269, 36, 145, 216, 37, 332, 276, 201, 278, + 303, 284, 293, 41, 42, 281, 12, 303, 303, 283, + 303, 211, 204, 312, 111, 303, 303, 198, 116, 70, + 288, 289, 290, 291, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 303, 303, 283, 303, 211, 303, 303, 105, 203, + 312, 198, 119, 49, 303, 117, 303, 303, 98, 303, + 254, 268, 269, 19, 303, 303, 303, 253, 276, 201, + 278, 303, 284, 293, 303, 283, 14, 211, 147, 303, + 111, 303, 15, 198, 119, 65, 197, 303, 303, 303, + 98, 303, 468, 268, 269, 468, 197, 303, 355, 468, + 276, 201, 278, 303, 284, 293, 303, 303, 389, 283, + 355, 211, 207, 303, 111, 303, 355, 198, 119, 65, + 389, 303, 303, 303, 98, 303, 389, 268, 269, 303, + 197, 468, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 303, 386, 283, 303, 211, 202, 303, 111, 303, + 303, 198, 116, 70, 386, 303, 303, 303, 98, 303, + 386, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 303, 303, 283, 303, 211, + 303, 303, 111, 303, 311, 198, 119, 65, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 303, + 303, 283, 303, 211, 206, 303, 105, 303, 303, 198, + 119, 56, 303, 233, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 115, 62, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 303, 303, 283, 303, 211, + 303, 303, 111, 303, 303, 193, 114, 57, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 198, 101, 80, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 303, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 102, 79, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 283, 303, 211, 303, 303, + 111, 303, 303, 198, 119, 53, 303, 303, 303, 303, + 98, 303, 303, 268, 269, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 303, 303, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 198, 119, 64, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 283, 303, 211, 303, 303, 111, 303, 303, 198, + 101, 54, 303, 303, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 303, 303, 303, 283, 303, 211, 303, 303, + 111, 303, 303, 198, 119, 63, 303, 303, 303, 303, + 98, 303, 303, 268, 269, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 303, 283, 303, 211, + 303, 303, 111, 303, 303, 198, 119, 55, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 303, + 303, 283, 303, 211, 303, 303, 111, 303, 303, 198, + 119, 56, 303, 303, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 119, 66, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 303, 303, 283, 303, 211, + 303, 303, 111, 303, 303, 198, 119, 67, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 198, 119, 68, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 303, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 119, 69, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 283, 303, 211, 303, 303, + 111, 303, 303, 198, 119, 71, 303, 303, 303, 303, + 98, 303, 303, 268, 269, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 303, 303, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 192, 119, 59, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 283, 303, 211, 303, 303, 111, 303, 303, 198, + 119, 60, 303, 303, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 303, 303, 303, 283, 303, 211, 303, 303, + 111, 303, 303, 198, 119, 61, 303, 303, 303, 303, + 98, 303, 303, 268, 269, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 303, 283, 303, 211, + 303, 303, 111, 303, 303, 198, 119, 72, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 303, + 303, 283, 303, 211, 303, 303, 111, 303, 303, 198, + 119, 73, 303, 303, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 119, 74, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 303, 303, 283, 303, 211, + 303, 303, 111, 303, 303, 198, 119, 75, 303, 303, + 303, 303, 98, 303, 303, 268, 269, 303, 303, 303, + 303, 303, 276, 201, 278, 303, 284, 293, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 198, 119, 76, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 303, 303, 283, 303, 211, 303, 303, 111, 303, + 303, 198, 119, 77, 303, 303, 303, 303, 98, 303, + 303, 268, 269, 303, 303, 303, 303, 303, 276, 201, + 278, 303, 284, 293, 303, 283, 303, 211, 303, 303, + 111, 303, 303, 198, 119, 78, 303, 303, 303, 303, + 98, 303, 303, 268, 269, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 303, 303, 303, 283, + 303, 211, 303, 303, 111, 303, 303, 198, 119, 48, + 303, 303, 303, 303, 98, 303, 303, 268, 269, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 303, 283, 303, 211, 303, 303, 111, 303, 303, 198, + 119, 50, 303, 303, 303, 303, 98, 303, 303, 268, + 269, 303, 303, 303, 303, 303, 276, 201, 278, 303, + 284, 293, 308, 303, 303, 303, 303, 303, 242, 243, + 244, 2, 303, 306, 303, 303, 303, 6, 84, 254, + 303, 303, 19, 109, 303, 303, 253, 212, 256, 213, + 303, 303, 38, 303, 14, 14, 303, 303, 303, 165, + 15, 15, 303, 303, 303, 41, 42, 281, 12, 251, + 303, 303, 46, 22, 280, 40, 303, 301, 27, 303, + 303, 308, 288, 289, 290, 291, 303, 242, 243, 244, + 2, 303, 306, 303, 303, 303, 6, 84, 303, 303, + 303, 303, 109, 303, 14, 303, 212, 256, 213, 303, + 15, 142, 303, 303, 303, 41, 42, 281, 12, 303, + 303, 251, 303, 303, 46, 22, 280, 40, 303, 303, + 303, 303, 288, 289, 290, 291, 302, 27, 303, 303, + 235, 236, 237, 130, 303, 303, 242, 243, 244, 1, + 468, 303, 303, 468, 303, 6, 84, 468, 452, 303, + 303, 109, 303, 303, 303, 212, 256, 213, 283, 303, + 211, 303, 303, 111, 303, 303, 198, 131, 303, 303, + 303, 303, 303, 98, 452, 303, 303, 452, 303, 468, + 303, 452, 326, 276, 201, 278, 303, 284, 293, 303, + 218, 303, 303, 283, 303, 211, 303, 468, 111, 303, + 468, 198, 125, 3, 468, 452, 303, 303, 98, 271, + 303, 303, 303, 303, 303, 303, 303, 282, 276, 201, + 278, 303, 284, 293, 283, 303, 211, 303, 303, 111, + 166, 452, 198, 129, 452, 303, 468, 303, 452, 98, + 251, 303, 303, 46, 22, 280, 40, 303, 303, 276, + 201, 278, 303, 284, 293, 303, 218, 303, 303, 283, + 303, 211, 303, 468, 111, 303, 468, 198, 120, 35, + 468, 452, 303, 303, 98, 271, 303, 303, 303, 303, + 303, 303, 303, 303, 276, 201, 278, 303, 284, 293, + 283, 303, 211, 303, 303, 111, 303, 452, 198, 121, + 452, 303, 468, 303, 452, 98, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 276, 201, 278, 303, 284, + 293, 303, 218, 303, 303, 283, 303, 211, 303, 468, + 111, 303, 468, 198, 122, 303, 468, 452, 303, 303, + 98, 271, 303, 303, 303, 303, 303, 303, 303, 303, + 276, 201, 278, 303, 284, 293, 283, 303, 211, 303, + 303, 111, 303, 452, 198, 123, 452, 303, 468, 303, + 452, 98, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 276, 201, 278, 303, 284, 293, 303, 30, 303, + 303, 283, 303, 211, 218, 468, 111, 303, 468, 198, + 124, 468, 468, 452, 468, 303, 98, 271, 468, 452, + 303, 303, 303, 271, 303, 303, 276, 201, 278, 303, + 284, 293, 283, 402, 211, 303, 303, 111, 303, 452, + 198, 128, 452, 303, 468, 452, 452, 98, 452, 303, + 468, 303, 452, 287, 303, 107, 325, 276, 201, 278, + 303, 284, 293, 303, 303, 439, 303, 402, 402, 402, + 402, 41, 42, 281, 12, 303, 303, 439, 303, 41, + 42, 281, 12, 303, 402, 402, 402, 402, 288, 289, + 290, 291, 41, 42, 281, 12, 288, 289, 290, 291, + 300, 324, 41, 42, 281, 12, 182, 315, 303, 288, + 289, 290, 291, 183, 303, 303, 303, 303, 303, 288, + 289, 290, 291, 41, 42, 281, 12, 31, 303, 41, + 42, 281, 12, 303, 327, 303, 41, 42, 281, 12, + 288, 289, 290, 291, 303, 303, 288, 289, 290, 291, + 303, 303, 303, 288, 289, 290, 291, 41, 42, 281, + 12, 41, 42, 281, 12, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 288, 289, 290, 291, 288, 289, + 290, 291, ); public static $yy_lookahead = array( - 2, 70, 61, 62, 73, 92, 34, 9, 10, 11, - 12, 80, 14, 100, 16, 43, 18, 19, 46, 21, - 1, 90, 24, 51, 13, 94, 28, 29, 30, 80, - 32, 20, 34, 22, 17, 37, 25, 39, 40, 41, - 42, 43, 31, 45, 33, 47, 35, 49, 50, 100, - 52, 85, 86, 87, 43, 57, 58, 9, 10, 11, - 12, 12, 14, 14, 16, 16, 18, 19, 65, 21, - 67, 12, 24, 14, 33, 16, 28, 29, 30, 1, - 32, 32, 34, 97, 96, 37, 98, 99, 40, 41, - 42, 43, 51, 45, 65, 47, 67, 49, 50, 51, - 52, 52, 15, 69, 17, 57, 58, 9, 10, 11, - 12, 52, 14, 13, 16, 15, 18, 19, 15, 21, - 17, 95, 24, 97, 20, 25, 28, 29, 30, 95, - 32, 31, 34, 46, 34, 37, 107, 33, 40, 41, - 42, 43, 65, 45, 67, 47, 46, 49, 50, 46, - 52, 1, 2, 17, 14, 57, 58, 9, 10, 11, - 12, 14, 14, 16, 16, 12, 18, 19, 95, 21, - 97, 72, 24, 17, 34, 76, 28, 29, 30, 43, - 32, 82, 34, 106, 107, 37, 50, 34, 40, 41, - 42, 43, 52, 45, 47, 47, 49, 49, 50, 52, - 52, 102, 46, 13, 1, 57, 58, 9, 10, 11, - 12, 21, 14, 70, 16, 25, 18, 19, 27, 21, - 77, 31, 24, 80, 95, 34, 28, 29, 30, 14, - 32, 16, 34, 82, 44, 37, 72, 46, 40, 41, - 42, 43, 70, 45, 69, 47, 82, 49, 50, 77, - 52, 15, 80, 13, 51, 57, 58, 9, 10, 11, - 12, 21, 14, 80, 16, 25, 18, 19, 79, 21, - 76, 31, 24, 98, 99, 25, 28, 29, 30, 43, - 32, 31, 34, 96, 44, 37, 50, 14, 40, 41, - 42, 43, 72, 45, 72, 47, 102, 49, 50, 14, - 52, 16, 82, 72, 82, 57, 58, 9, 10, 11, - 12, 72, 14, 82, 16, 1, 18, 19, 76, 21, - 95, 82, 24, 15, 102, 52, 28, 29, 30, 21, - 32, 17, 34, 102, 49, 37, 97, 52, 40, 41, - 42, 43, 70, 45, 102, 47, 9, 49, 50, 12, - 52, 70, 80, 16, 73, 57, 58, 9, 10, 11, - 12, 80, 14, 21, 16, 95, 18, 19, 6, 21, - 8, 72, 24, 98, 99, 94, 28, 29, 30, 92, - 32, 82, 34, 1, 2, 37, 44, 100, 40, 41, - 42, 43, 72, 45, 76, 47, 97, 49, 50, 76, - 52, 59, 82, 1, 14, 57, 58, 9, 10, 11, - 12, 43, 14, 72, 16, 102, 18, 19, 50, 21, - 102, 103, 24, 82, 80, 102, 28, 29, 30, 27, - 32, 25, 34, 98, 99, 37, 80, 31, 40, 41, - 42, 43, 52, 45, 33, 47, 35, 49, 50, 16, + 2, 1, 97, 13, 99, 100, 21, 9, 10, 11, + 12, 21, 14, 70, 16, 25, 18, 19, 1, 21, + 77, 31, 24, 80, 13, 69, 28, 29, 30, 44, + 32, 20, 34, 22, 44, 37, 25, 39, 40, 41, + 42, 43, 31, 45, 33, 47, 35, 49, 50, 14, + 52, 16, 96, 17, 43, 57, 58, 9, 10, 11, + 12, 65, 14, 67, 16, 33, 18, 19, 65, 21, + 67, 70, 24, 96, 73, 98, 28, 29, 30, 43, + 32, 80, 34, 51, 49, 37, 50, 52, 40, 41, + 42, 43, 91, 45, 1, 47, 95, 49, 50, 51, + 52, 15, 96, 107, 108, 57, 58, 9, 10, 11, + 12, 72, 14, 13, 16, 15, 18, 19, 25, 21, + 80, 82, 24, 72, 31, 25, 28, 29, 30, 43, + 32, 31, 34, 82, 34, 37, 50, 98, 40, 41, + 42, 43, 15, 45, 17, 47, 46, 49, 50, 98, + 52, 21, 61, 62, 98, 57, 58, 9, 10, 11, + 12, 14, 14, 16, 16, 80, 18, 19, 96, 21, + 98, 93, 24, 46, 44, 34, 28, 29, 30, 101, + 32, 51, 34, 17, 43, 37, 101, 46, 40, 41, + 42, 43, 51, 45, 47, 47, 49, 49, 50, 52, + 52, 85, 86, 87, 88, 57, 58, 9, 10, 11, + 12, 12, 14, 14, 16, 16, 18, 19, 9, 21, + 82, 12, 24, 72, 72, 16, 28, 29, 30, 1, + 32, 32, 34, 82, 82, 37, 99, 100, 40, 41, + 42, 43, 72, 45, 79, 47, 76, 49, 50, 80, + 52, 52, 82, 13, 103, 57, 58, 9, 10, 11, + 12, 21, 14, 14, 16, 25, 18, 19, 65, 21, + 67, 31, 24, 103, 1, 2, 28, 29, 30, 51, + 32, 25, 34, 34, 44, 37, 80, 31, 40, 41, + 42, 43, 72, 45, 70, 47, 76, 49, 50, 14, + 52, 52, 82, 72, 80, 57, 58, 9, 10, 11, + 12, 108, 14, 82, 16, 76, 18, 19, 15, 21, + 17, 70, 24, 103, 73, 93, 28, 29, 30, 43, + 32, 80, 34, 101, 103, 37, 50, 52, 40, 41, + 42, 43, 103, 45, 70, 47, 95, 49, 50, 46, + 52, 77, 78, 69, 80, 57, 58, 9, 10, 11, + 12, 12, 14, 14, 16, 16, 18, 19, 9, 21, + 1, 12, 24, 1, 2, 16, 28, 29, 30, 97, + 32, 25, 34, 99, 100, 37, 17, 31, 40, 41, + 42, 43, 70, 45, 76, 47, 76, 49, 50, 77, + 52, 52, 80, 72, 17, 57, 58, 9, 10, 11, + 12, 21, 14, 82, 16, 96, 18, 19, 27, 21, + 96, 103, 24, 103, 104, 34, 28, 29, 30, 6, + 32, 8, 34, 46, 44, 37, 72, 46, 40, 41, + 42, 43, 14, 45, 16, 47, 82, 49, 50, 59, 52, 36, 37, 38, 39, 57, 58, 9, 10, 11, - 12, 95, 14, 34, 16, 2, 18, 19, 53, 54, - 55, 56, 24, 21, 59, 46, 28, 29, 30, 43, - 32, 48, 34, 63, 64, 37, 50, 34, 40, 41, - 42, 43, 33, 45, 35, 47, 44, 49, 50, 46, + 12, 1, 14, 96, 16, 72, 18, 19, 53, 54, + 55, 56, 24, 15, 59, 82, 28, 29, 30, 21, + 32, 20, 34, 16, 76, 37, 103, 27, 40, 41, + 42, 43, 2, 45, 33, 47, 104, 49, 50, 14, 52, 36, 37, 38, 39, 57, 58, 9, 10, 11, - 12, 34, 14, 33, 16, 35, 18, 19, 53, 54, - 55, 56, 24, 46, 7, 8, 28, 29, 30, 43, - 32, 103, 34, 34, 33, 37, 35, 51, 40, 41, - 42, 43, 95, 45, 99, 47, 64, 49, 50, 81, - 52, 15, 81, 81, 7, 57, 58, 65, 66, 67, - 68, 70, 70, 71, 95, 73, 74, 75, 77, 78, - 9, 80, 80, 12, 72, 83, 84, 16, 76, 43, - 95, 89, 90, 91, 82, 93, 94, 13, 65, 66, - 67, 68, 9, 70, 71, 12, 73, 74, 75, 16, - 13, 16, 16, 80, 102, 72, 83, 84, 16, 48, - 16, 16, 89, 90, 91, 82, 93, 94, 85, 86, - 87, 65, 14, 67, 68, 16, 70, 71, 32, 73, - 74, 75, 43, 65, 32, 67, 80, 21, 70, 83, - 84, 73, 74, 75, 34, 89, 90, 91, 80, 93, - 94, 83, 84, 26, 16, 16, 49, 89, 90, 91, - 44, 93, 94, 36, 37, 38, 39, 51, 49, 65, - 16, 67, 104, 105, 70, 51, 1, 73, 74, 75, - 53, 54, 55, 56, 80, 51, 15, 83, 84, 1, - 16, 35, 108, 89, 90, 91, 108, 93, 94, 22, - 25, 13, 65, 108, 67, 17, 31, 70, 104, 105, - 73, 74, 75, 25, 77, 108, 108, 80, 108, 31, - 83, 84, 34, 108, 108, 108, 89, 90, 91, 108, - 93, 94, 108, 108, 46, 65, 108, 67, 108, 108, - 70, 108, 108, 73, 74, 75, 108, 108, 108, 108, - 80, 108, 72, 83, 84, 108, 108, 108, 108, 89, - 90, 91, 82, 93, 94, 85, 86, 87, 65, 108, - 67, 101, 108, 70, 108, 108, 73, 74, 75, 108, - 108, 108, 108, 80, 108, 72, 83, 84, 108, 108, - 108, 108, 89, 90, 91, 82, 93, 94, 85, 86, - 87, 65, 108, 67, 101, 108, 70, 108, 108, 73, - 74, 75, 108, 108, 108, 108, 80, 108, 108, 83, - 84, 1, 108, 108, 108, 89, 90, 91, 108, 93, - 94, 108, 108, 13, 65, 108, 67, 108, 108, 70, - 108, 105, 73, 74, 75, 25, 108, 108, 108, 80, - 108, 31, 83, 84, 1, 108, 108, 108, 89, 90, - 91, 108, 93, 94, 108, 108, 13, 65, 108, 67, - 101, 108, 70, 108, 108, 73, 74, 75, 25, 77, - 108, 108, 80, 108, 31, 83, 84, 1, 108, 108, - 108, 89, 90, 91, 108, 93, 94, 108, 108, 13, - 65, 108, 67, 108, 108, 70, 108, 108, 73, 74, - 75, 25, 108, 108, 108, 80, 108, 31, 83, 84, - 108, 108, 108, 108, 89, 90, 91, 9, 93, 94, - 12, 108, 108, 65, 16, 67, 108, 9, 70, 108, - 12, 73, 74, 75, 16, 65, 108, 67, 80, 108, - 70, 83, 84, 73, 74, 75, 108, 89, 90, 91, - 80, 93, 94, 83, 84, 9, 48, 108, 12, 89, - 90, 91, 16, 93, 94, 65, 48, 67, 108, 108, - 70, 25, 108, 73, 74, 75, 108, 31, 108, 108, - 80, 108, 108, 83, 84, 108, 108, 108, 108, 89, - 90, 91, 108, 93, 94, 108, 108, 65, 108, 67, - 108, 108, 70, 108, 108, 73, 74, 75, 108, 65, - 108, 67, 80, 108, 70, 83, 84, 73, 74, 75, - 108, 89, 90, 91, 80, 93, 94, 83, 84, 108, - 108, 108, 108, 89, 90, 91, 108, 93, 94, 65, - 108, 67, 108, 108, 70, 108, 108, 73, 74, 75, - 108, 108, 108, 108, 80, 108, 108, 83, 84, 108, - 108, 108, 108, 89, 90, 91, 108, 93, 94, 108, - 108, 65, 108, 67, 108, 108, 70, 108, 108, 73, - 74, 75, 108, 65, 108, 67, 80, 108, 70, 83, - 84, 73, 74, 75, 108, 89, 90, 91, 80, 93, - 94, 83, 84, 108, 108, 108, 108, 89, 90, 91, - 108, 93, 94, 65, 108, 67, 108, 108, 70, 108, - 108, 73, 74, 75, 108, 108, 108, 108, 80, 108, - 108, 83, 84, 108, 108, 108, 108, 89, 90, 91, - 108, 93, 94, 108, 108, 65, 108, 67, 108, 108, - 70, 108, 108, 73, 74, 75, 108, 65, 108, 67, - 80, 108, 70, 83, 84, 73, 74, 75, 108, 89, - 90, 91, 80, 93, 94, 83, 84, 108, 108, 108, - 108, 89, 90, 91, 108, 93, 94, 65, 108, 67, - 108, 108, 70, 108, 108, 73, 74, 75, 108, 108, - 108, 108, 80, 108, 108, 83, 84, 108, 108, 108, - 108, 89, 90, 91, 108, 93, 94, 108, 108, 65, - 108, 67, 108, 108, 70, 108, 108, 73, 74, 75, - 108, 65, 108, 67, 80, 108, 70, 83, 84, 73, - 74, 75, 108, 89, 90, 91, 80, 93, 94, 83, - 84, 108, 108, 108, 108, 89, 90, 91, 108, 93, - 94, 65, 108, 67, 108, 108, 70, 108, 108, 73, - 74, 75, 108, 108, 108, 108, 80, 108, 108, 83, - 84, 108, 108, 108, 108, 89, 90, 91, 108, 93, - 94, 108, 108, 65, 108, 67, 108, 108, 70, 108, - 108, 73, 74, 75, 108, 65, 108, 67, 80, 108, - 70, 83, 84, 73, 74, 75, 108, 89, 90, 91, - 80, 93, 94, 83, 84, 108, 108, 108, 108, 89, - 90, 91, 108, 93, 94, 65, 108, 67, 108, 108, - 70, 108, 108, 73, 74, 75, 108, 108, 108, 108, - 80, 108, 108, 83, 84, 108, 108, 108, 108, 89, - 90, 91, 108, 93, 94, 108, 108, 65, 108, 67, - 108, 108, 70, 108, 108, 73, 74, 75, 108, 65, - 108, 67, 80, 108, 70, 83, 84, 73, 74, 75, - 108, 89, 90, 91, 80, 93, 94, 83, 84, 108, - 108, 108, 108, 89, 90, 91, 108, 93, 94, 65, - 108, 67, 108, 108, 70, 108, 108, 73, 74, 75, - 108, 108, 108, 108, 80, 108, 108, 83, 84, 108, - 108, 108, 108, 89, 90, 91, 108, 93, 94, 108, - 108, 65, 108, 67, 108, 108, 70, 108, 108, 73, - 74, 75, 108, 65, 108, 67, 80, 108, 70, 83, - 84, 73, 74, 75, 108, 89, 90, 91, 80, 93, - 94, 83, 84, 108, 108, 108, 108, 89, 90, 91, - 108, 93, 94, 65, 108, 67, 108, 108, 70, 108, - 108, 73, 74, 75, 108, 108, 108, 108, 80, 108, - 108, 83, 84, 108, 108, 108, 108, 89, 90, 91, - 108, 93, 94, 108, 108, 65, 108, 67, 108, 108, - 70, 108, 108, 73, 74, 75, 108, 65, 108, 67, - 80, 108, 70, 83, 84, 73, 74, 75, 108, 89, - 90, 91, 80, 93, 94, 83, 84, 108, 108, 108, - 108, 89, 90, 91, 108, 93, 94, 3, 20, 108, - 108, 108, 108, 9, 10, 11, 12, 108, 14, 108, - 108, 108, 18, 19, 36, 37, 38, 39, 24, 108, - 108, 108, 28, 29, 30, 108, 108, 23, 108, 25, - 108, 53, 54, 55, 56, 31, 108, 108, 108, 108, - 36, 37, 38, 39, 108, 108, 108, 108, 108, 108, - 108, 108, 58, 59, 108, 108, 3, 53, 54, 55, - 56, 108, 9, 10, 11, 12, 108, 14, 108, 108, - 108, 18, 19, 108, 108, 108, 108, 24, 108, 25, - 108, 28, 29, 30, 108, 31, 108, 108, 108, 108, - 36, 37, 38, 39, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 53, 54, 55, - 56, 58, 59, 108, 108, 3, 4, 5, 6, 108, - 108, 9, 10, 11, 12, 108, 108, 108, 108, 108, - 18, 19, 108, 108, 108, 108, 24, 108, 108, 108, - 28, 29, 30, 65, 108, 67, 108, 108, 70, 108, - 108, 73, 74, 108, 108, 108, 108, 108, 80, 108, - 108, 108, 108, 108, 108, 108, 88, 89, 90, 91, - 108, 93, 94, 108, 108, 108, 108, 108, 65, 108, - 67, 108, 108, 70, 108, 108, 73, 74, 108, 108, - 65, 108, 67, 80, 108, 70, 108, 108, 73, 74, - 108, 88, 89, 90, 91, 80, 93, 94, 108, 108, - 108, 108, 108, 108, 89, 90, 91, 108, 93, 94, - 108, 108, 108, 108, 65, 108, 67, 108, 108, 70, - 108, 108, 73, 74, 108, 108, 108, 108, 108, 80, - 108, 108, 108, 108, 108, 108, 108, 108, 89, 90, - 91, 108, 93, 94, 108, 108, 65, 108, 67, 108, - 108, 70, 108, 108, 73, 74, 108, 108, 65, 108, - 67, 80, 108, 70, 108, 108, 73, 74, 108, 108, - 89, 90, 91, 80, 93, 94, 108, 108, 108, 108, - 108, 108, 89, 90, 91, 108, 93, 94, 65, 108, - 67, 108, 108, 70, 108, 108, 73, 74, 108, 108, - 108, 108, 108, 80, 108, 108, 108, 108, 108, 108, - 108, 108, 89, 90, 91, 108, 93, 94, 108, 108, - 65, 108, 67, 108, 108, 70, 108, 108, 73, 74, - 108, 108, 65, 108, 67, 80, 108, 70, 108, 108, - 73, 74, 108, 108, 89, 90, 91, 80, 93, 94, - 108, 108, 2, 108, 108, 108, 89, 90, 91, 9, - 93, 94, 12, 2, 108, 15, 16, 17, 108, 108, - 9, 21, 108, 12, 108, 108, 2, 16, 17, 108, - 108, 9, 21, 9, 12, 108, 12, 108, 16, 15, - 16, 17, 108, 43, 2, 21, 46, 25, 48, 27, - 50, 108, 108, 31, 43, 108, 108, 46, 108, 48, - 108, 50, 51, 108, 108, 108, 108, 43, 108, 108, - 46, 108, 48, 108, 50, 2, 34, 108, 36, 37, - 38, 39, 9, 108, 108, 12, 108, 108, 46, 16, - 17, 108, 2, 108, 21, 53, 54, 55, 56, 9, - 108, 108, 12, 108, 13, 108, 16, 17, 108, 108, - 108, 21, 108, 108, 108, 108, 43, 108, 108, 46, - 108, 48, 108, 50, 108, 108, 108, 36, 37, 38, - 39, 108, 108, 43, 108, 13, 46, 108, 48, 108, - 50, 108, 108, 108, 53, 54, 55, 56, 36, 37, - 38, 39, 35, 36, 37, 38, 39, 108, 36, 37, - 38, 39, 13, 51, 2, 53, 54, 55, 56, 13, - 53, 54, 55, 56, 108, 53, 54, 55, 56, 108, - 108, 108, 108, 108, 108, 36, 37, 38, 39, 108, - 108, 108, 36, 37, 38, 39, 108, 108, 36, 37, - 38, 39, 53, 54, 55, 56, 13, 108, 108, 53, - 54, 55, 56, 108, 108, 53, 54, 55, 56, 9, - 108, 108, 12, 108, 108, 108, 16, 17, 108, 36, - 37, 38, 39, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 53, 54, 55, 56, - 108, 108, 108, 43, 108, 108, 46, 108, 48, 108, - 50, + 12, 103, 14, 34, 16, 48, 18, 19, 53, 54, + 55, 56, 24, 99, 100, 46, 28, 29, 30, 12, + 32, 34, 34, 63, 64, 37, 96, 52, 40, 41, + 42, 43, 43, 45, 33, 47, 35, 49, 50, 50, + 52, 34, 34, 7, 8, 57, 58, 65, 66, 67, + 68, 81, 70, 71, 46, 73, 74, 75, 34, 33, + 9, 35, 80, 12, 100, 83, 84, 16, 64, 96, + 46, 81, 90, 91, 92, 81, 94, 95, 65, 66, + 67, 68, 1, 70, 71, 7, 73, 74, 75, 33, + 15, 35, 43, 80, 13, 96, 83, 84, 17, 48, + 51, 13, 16, 90, 91, 92, 25, 94, 95, 13, + 16, 65, 31, 67, 68, 34, 70, 71, 43, 73, + 74, 75, 33, 16, 35, 9, 80, 46, 12, 83, + 84, 16, 16, 16, 14, 16, 90, 91, 92, 34, + 94, 95, 65, 43, 67, 32, 16, 70, 16, 16, + 73, 74, 75, 32, 51, 49, 16, 80, 49, 51, + 83, 84, 15, 26, 48, 22, 35, 90, 91, 92, + 109, 94, 95, 36, 37, 38, 39, 109, 109, 65, + 109, 67, 105, 106, 70, 109, 109, 73, 74, 75, + 53, 54, 55, 56, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 109, 109, 65, 109, 67, 109, 109, 70, 105, + 106, 73, 74, 75, 109, 77, 109, 109, 80, 109, + 9, 83, 84, 12, 109, 109, 109, 16, 90, 91, + 92, 109, 94, 95, 109, 65, 25, 67, 27, 109, + 70, 109, 31, 73, 74, 75, 1, 109, 109, 109, + 80, 109, 9, 83, 84, 12, 1, 109, 13, 16, + 90, 91, 92, 109, 94, 95, 109, 109, 13, 65, + 25, 67, 102, 109, 70, 109, 31, 73, 74, 75, + 25, 109, 109, 109, 80, 109, 31, 83, 84, 109, + 1, 48, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 109, 13, 65, 109, 67, 102, 109, 70, 109, + 109, 73, 74, 75, 25, 109, 109, 109, 80, 109, + 31, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 109, 109, 65, 109, 67, + 109, 109, 70, 109, 106, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 109, + 109, 65, 109, 67, 102, 109, 70, 109, 109, 73, + 74, 75, 109, 77, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 109, 109, 65, 109, 67, + 109, 109, 70, 109, 109, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 109, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 65, 109, 67, 109, 109, + 70, 109, 109, 73, 74, 75, 109, 109, 109, 109, + 80, 109, 109, 83, 84, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 109, 109, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 65, 109, 67, 109, 109, 70, 109, 109, 73, + 74, 75, 109, 109, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 109, 109, 109, 65, 109, 67, 109, 109, + 70, 109, 109, 73, 74, 75, 109, 109, 109, 109, + 80, 109, 109, 83, 84, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 109, 65, 109, 67, + 109, 109, 70, 109, 109, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 109, + 109, 65, 109, 67, 109, 109, 70, 109, 109, 73, + 74, 75, 109, 109, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 109, 109, 65, 109, 67, + 109, 109, 70, 109, 109, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 109, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 65, 109, 67, 109, 109, + 70, 109, 109, 73, 74, 75, 109, 109, 109, 109, + 80, 109, 109, 83, 84, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 109, 109, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 65, 109, 67, 109, 109, 70, 109, 109, 73, + 74, 75, 109, 109, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 109, 109, 109, 65, 109, 67, 109, 109, + 70, 109, 109, 73, 74, 75, 109, 109, 109, 109, + 80, 109, 109, 83, 84, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 109, 65, 109, 67, + 109, 109, 70, 109, 109, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 109, + 109, 65, 109, 67, 109, 109, 70, 109, 109, 73, + 74, 75, 109, 109, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 109, 109, 65, 109, 67, + 109, 109, 70, 109, 109, 73, 74, 75, 109, 109, + 109, 109, 80, 109, 109, 83, 84, 109, 109, 109, + 109, 109, 90, 91, 92, 109, 94, 95, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 109, 109, 65, 109, 67, 109, 109, 70, 109, + 109, 73, 74, 75, 109, 109, 109, 109, 80, 109, + 109, 83, 84, 109, 109, 109, 109, 109, 90, 91, + 92, 109, 94, 95, 109, 65, 109, 67, 109, 109, + 70, 109, 109, 73, 74, 75, 109, 109, 109, 109, + 80, 109, 109, 83, 84, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 109, 109, 109, 65, + 109, 67, 109, 109, 70, 109, 109, 73, 74, 75, + 109, 109, 109, 109, 80, 109, 109, 83, 84, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 109, 65, 109, 67, 109, 109, 70, 109, 109, 73, + 74, 75, 109, 109, 109, 109, 80, 109, 109, 83, + 84, 109, 109, 109, 109, 109, 90, 91, 92, 109, + 94, 95, 3, 109, 109, 109, 109, 109, 9, 10, + 11, 12, 109, 14, 109, 109, 109, 18, 19, 9, + 109, 109, 12, 24, 109, 109, 16, 28, 29, 30, + 109, 109, 23, 109, 25, 25, 109, 109, 109, 72, + 31, 31, 109, 109, 109, 36, 37, 38, 39, 82, + 109, 109, 85, 86, 87, 88, 109, 58, 59, 109, + 109, 3, 53, 54, 55, 56, 109, 9, 10, 11, + 12, 109, 14, 109, 109, 109, 18, 19, 109, 109, + 109, 109, 24, 109, 25, 109, 28, 29, 30, 109, + 31, 72, 109, 109, 109, 36, 37, 38, 39, 109, + 109, 82, 109, 109, 85, 86, 87, 88, 109, 109, + 109, 109, 53, 54, 55, 56, 58, 59, 109, 109, + 3, 4, 5, 6, 109, 109, 9, 10, 11, 12, + 9, 109, 109, 12, 109, 18, 19, 16, 17, 109, + 109, 24, 109, 109, 109, 28, 29, 30, 65, 109, + 67, 109, 109, 70, 109, 109, 73, 74, 109, 109, + 109, 109, 109, 80, 43, 109, 109, 46, 109, 48, + 109, 50, 89, 90, 91, 92, 109, 94, 95, 109, + 2, 109, 109, 65, 109, 67, 109, 9, 70, 109, + 12, 73, 74, 15, 16, 17, 109, 109, 80, 21, + 109, 109, 109, 109, 109, 109, 109, 89, 90, 91, + 92, 109, 94, 95, 65, 109, 67, 109, 109, 70, + 72, 43, 73, 74, 46, 109, 48, 109, 50, 80, + 82, 109, 109, 85, 86, 87, 88, 109, 109, 90, + 91, 92, 109, 94, 95, 109, 2, 109, 109, 65, + 109, 67, 109, 9, 70, 109, 12, 73, 74, 15, + 16, 17, 109, 109, 80, 21, 109, 109, 109, 109, + 109, 109, 109, 109, 90, 91, 92, 109, 94, 95, + 65, 109, 67, 109, 109, 70, 109, 43, 73, 74, + 46, 109, 48, 109, 50, 80, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 90, 91, 92, 109, 94, + 95, 109, 2, 109, 109, 65, 109, 67, 109, 9, + 70, 109, 12, 73, 74, 109, 16, 17, 109, 109, + 80, 21, 109, 109, 109, 109, 109, 109, 109, 109, + 90, 91, 92, 109, 94, 95, 65, 109, 67, 109, + 109, 70, 109, 43, 73, 74, 46, 109, 48, 109, + 50, 80, 109, 109, 109, 109, 109, 109, 109, 109, + 109, 90, 91, 92, 109, 94, 95, 109, 2, 109, + 109, 65, 109, 67, 2, 9, 70, 109, 12, 73, + 74, 9, 16, 17, 12, 109, 80, 21, 16, 17, + 109, 109, 109, 21, 109, 109, 90, 91, 92, 109, + 94, 95, 65, 2, 67, 109, 109, 70, 109, 43, + 73, 74, 46, 109, 48, 43, 50, 80, 46, 109, + 48, 109, 50, 51, 109, 20, 13, 90, 91, 92, + 109, 94, 95, 109, 109, 34, 109, 36, 37, 38, + 39, 36, 37, 38, 39, 109, 109, 46, 109, 36, + 37, 38, 39, 109, 53, 54, 55, 56, 53, 54, + 55, 56, 36, 37, 38, 39, 53, 54, 55, 56, + 13, 35, 36, 37, 38, 39, 13, 51, 109, 53, + 54, 55, 56, 13, 109, 109, 109, 109, 109, 53, + 54, 55, 56, 36, 37, 38, 39, 2, 109, 36, + 37, 38, 39, 109, 13, 109, 36, 37, 38, 39, + 53, 54, 55, 56, 109, 109, 53, 54, 55, 56, + 109, 109, 109, 53, 54, 55, 56, 36, 37, 38, + 39, 36, 37, 38, 39, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 53, 54, 55, 56, 53, 54, + 55, 56, ); - const YY_SHIFT_USE_DFLT = -29; + const YY_SHIFT_USE_DFLT = -16; const YY_SHIFT_MAX = 234; public static $yy_shift_ofst = array( - -29, 98, 98, 148, 198, 198, 248, 148, 148, 198, + -16, 98, 98, 148, 198, 198, 248, 148, 148, 198, 148, 248, -2, 48, 298, 148, 148, 148, 298, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 348, 148, 148, 148, 148, 398, 148, 148, 148, 448, - 498, 498, 498, 498, 498, 498, 498, 498, 1574, 1624, - 1624, 147, 1564, 688, 285, 140, 675, 1623, 1548, 627, - 2021, 2047, 2042, 2052, 415, 2079, 2086, 2092, 2123, 465, + 498, 498, 498, 498, 498, 498, 498, 498, 1819, 1869, + 1869, 147, 1809, 2225, 647, 2233, 2256, 2246, 2277, 415, + 2283, 2290, 2315, 2311, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - 465, 465, 465, 465, 465, 465, 465, 1952, 956, 136, - 87, 675, 675, 140, 140, 150, 1682, 1930, 561, 59, - 820, 853, 886, 337, 337, 103, 250, 273, 250, 406, - 314, 156, 215, 215, 203, 382, 402, 250, 19, 19, - 19, 19, 19, 19, 19, 19, 17, 17, 78, 19, - -29, -29, 1941, 1954, 2003, 2020, 2140, 49, 918, 583, - 236, 250, 250, 308, 250, 390, 250, 390, 250, 368, - 368, 250, 250, 250, 250, 368, 153, 368, 368, 368, - 436, 368, 436, 368, 250, 250, 250, 250, 19, 463, - 19, 19, 463, 19, 499, 17, 17, 17, -29, -29, - -29, -29, -29, -29, 1972, 11, 100, 190, 240, 928, - -28, 191, 342, 616, 362, 517, 104, 433, 452, 429, - 453, 477, 411, 459, 41, 486, 480, 501, 536, 547, - 574, 587, 585, 586, 592, 594, 595, 608, 609, 589, - 596, 602, 610, 638, 499, 639, 607, 619, 654, 624, - 634, 674, 671, 656, 677, + 465, 465, 591, 35, 249, 93, 1868, 731, 1820, 36, + 127, 93, 93, 249, 249, 273, 1927, 1988, 561, 349, + 765, 775, 809, 209, 209, 303, 256, 285, 256, 356, + 369, 387, 428, 428, 228, 372, 460, 256, 0, 0, + 0, 0, 0, 0, 0, 0, 166, 166, 17, 0, + -16, -16, 2192, 2054, 2120, 2186, 1931, 199, 626, 359, + 86, 256, 256, 458, 256, 485, 256, 485, 256, 286, + 286, 256, 256, 256, 256, 286, 517, 286, 286, 286, + 499, 286, 499, 286, 256, 256, 256, 256, 0, 490, + 0, 0, 490, 0, 497, 166, 166, 166, -16, -16, + -16, -16, -16, -16, 2221, 11, 100, -10, 240, 763, + 141, 391, 390, 130, 423, 546, 461, 467, -15, 479, + 518, 534, 511, 536, 32, 559, 566, 599, 585, 588, + 598, 606, 596, 604, 617, 625, 627, 630, 629, 610, + 623, 631, 615, 640, 497, 642, 616, 619, 643, 613, + 618, 650, 657, 641, 653, ); - const YY_REDUCE_USE_DFLT = -88; + const YY_REDUCE_USE_DFLT = -96; const YY_REDUCE_MAX = 183; public static $yy_reduce_ofst = array( - -59, 492, 523, 556, 568, 604, 637, 670, 703, 736, - 769, 802, 835, 868, 880, 910, 942, 954, 984, 1016, - 1028, 1058, 1090, 1102, 1132, 1164, 1176, 1206, 1238, 1250, - 1280, 1312, 1324, 1354, 1386, 1398, 1428, 1460, 1472, 1648, - 1683, 1695, 1729, 1761, 1773, 1803, 1835, 1847, 533, 680, - 713, -69, 77, 99, 281, 491, 502, 29, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, 239, 299, -12, - 175, 222, 231, 143, 172, 318, 3, 34, 26, -51, - 194, 194, 194, 73, 26, 275, 164, 272, 220, 320, - 242, 275, -87, 287, 194, 194, 194, 341, 323, 194, - 194, 194, 194, 194, 194, 194, 275, 335, 194, 194, - 420, 194, 129, 129, 129, 129, 129, 183, -14, 129, - 129, 151, 151, 189, 151, 344, 151, 356, 151, 187, - 187, 151, 151, 151, 151, 187, 225, 187, 187, 187, - 270, 187, 366, 187, 151, 151, 151, 151, 313, 428, - 313, 313, 428, 313, 447, 445, 445, 445, 482, 468, - 471, 472, 469, 485, + 91, 492, 523, 556, 587, 624, 658, 690, 724, 758, + 792, 826, 858, 892, 924, 958, 990, 1024, 1056, 1090, + 1122, 1156, 1188, 1222, 1254, 1288, 1320, 1354, 1386, 1420, + 1452, 1486, 1518, 1552, 1584, 1618, 1650, 1684, 1716, 1893, + 1928, 1959, 1994, 2025, 2060, 2091, 2126, 2157, 1777, 1829, + 1958, 1, -4, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 170, 251, 274, 220, 203, 39, 51, -95, + 284, 151, 231, -57, 322, 320, 3, -44, -23, 85, + 239, 239, 239, 72, -23, 137, 152, 224, 331, 364, + 318, 137, 78, 232, 239, 239, 239, 393, 408, 239, + 239, 239, 239, 239, 239, 239, 137, 424, 239, 239, + 470, 239, 6, 6, 6, 6, 6, 40, 56, 6, + 6, 138, 138, 165, 138, 169, 138, 206, 138, 282, + 282, 138, 138, 138, 138, 282, 319, 282, 282, 282, + 324, 282, 367, 282, 138, 138, 138, 138, 383, 392, + 383, 383, 392, 383, 440, 474, 474, 474, 514, 480, + 500, 504, 483, 509, ); public static $yyExpectedTokens = array( array(), @@ -817,11 +853,6 @@ private function mergePrefixCode($code) array(25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), array(14, 16, 47, 49, 52, ), array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), - array(1, 13, 17, 25, 31, 34, 46, ), - array(14, 16, 49, 52, ), - array(14, 34, 52, ), - array(1, 25, 31, ), - array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), array(20, 36, 37, 38, 39, 53, 54, 55, 56, ), array(26, 36, 37, 38, 39, 53, 54, 55, 56, ), array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), @@ -851,6 +882,11 @@ private function mergePrefixCode($code) array(36, 37, 38, 39, 53, 54, 55, 56, ), array(36, 37, 38, 39, 53, 54, 55, 56, ), array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(1, 13, 17, 25, 31, 34, 46, ), + array(14, 16, 49, 52, ), + array(14, 34, 52, ), + array(1, 25, 31, ), + array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), array(9, 12, 16, 25, 27, 31, ), array(9, 12, 16, 25, 31, ), array(17, 43, 50, ), @@ -1096,47 +1132,48 @@ private function mergePrefixCode($code) array(), array(), array(), + array(), ); public static $yy_default = array( - 342, 523, 523, 523, 508, 508, 523, 485, 485, 523, - 485, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 382, 361, - 382, 523, 523, 424, 523, 523, 382, 523, 523, 387, - 523, 523, 523, 355, 523, 523, 523, 523, 523, 366, - 484, 405, 411, 483, 509, 511, 510, 410, 412, 409, - 413, 389, 393, 394, 384, 387, 355, 382, 382, 498, - 440, 382, 382, 523, 523, 373, 332, 439, 450, 523, - 396, 396, 396, 450, 450, 440, 382, 523, 382, 382, - 376, 440, 523, 523, 396, 396, 396, 363, 378, 396, - 403, 415, 416, 417, 404, 408, 440, 495, 415, 402, - 340, 492, 439, 439, 439, 439, 439, 523, 452, 450, - 466, 352, 362, 523, 365, 523, 370, 523, 371, 447, - 448, 356, 358, 359, 360, 476, 450, 475, 478, 477, - 443, 444, 445, 446, 372, 368, 369, 364, 374, 486, - 377, 379, 487, 433, 450, 472, 499, 496, 340, 491, - 491, 491, 450, 450, 424, 420, 424, 414, 414, 451, - 424, 424, 414, 414, 338, 523, 523, 523, 414, 424, - 434, 523, 523, 523, 523, 420, 523, 523, 420, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 420, - 422, 523, 497, 523, 466, 523, 523, 523, 523, 523, - 429, 523, 523, 523, 390, 333, 334, 335, 336, 337, - 339, 341, 343, 344, 345, 346, 347, 348, 349, 351, - 380, 381, 468, 469, 470, 490, 375, 488, 489, 418, - 427, 428, 437, 438, 449, 453, 454, 455, 397, 398, - 399, 400, 401, 419, 421, 423, 425, 429, 430, 431, - 406, 407, 432, 435, 436, 463, 461, 500, 501, 502, - 503, 441, 442, 474, 467, 482, 350, 473, 519, 520, - 512, 513, 514, 517, 516, 518, 521, 522, 515, 505, - 507, 506, 504, 479, 464, 462, 460, 457, 458, 459, - 465, 480, 481, 426, 456, 494, 471, 466, 383, 367, - 391, 395, + 343, 525, 525, 525, 510, 510, 525, 487, 487, 525, + 487, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 383, 362, + 383, 525, 525, 525, 388, 525, 525, 525, 356, 525, + 525, 525, 525, 525, 367, 486, 406, 413, 485, 511, + 513, 512, 412, 414, 411, 415, 390, 394, 395, 385, + 388, 356, 426, 525, 525, 383, 525, 383, 383, 500, + 442, 383, 383, 525, 525, 374, 333, 441, 452, 525, + 397, 397, 397, 452, 452, 442, 383, 525, 383, 383, + 377, 442, 525, 525, 397, 397, 397, 364, 379, 397, + 404, 417, 418, 419, 405, 410, 442, 497, 417, 403, + 341, 494, 441, 441, 441, 441, 441, 525, 454, 452, + 468, 353, 363, 525, 366, 525, 371, 525, 372, 449, + 450, 357, 359, 360, 361, 478, 452, 477, 480, 479, + 445, 446, 447, 448, 373, 369, 370, 365, 375, 488, + 378, 380, 489, 435, 452, 474, 501, 498, 341, 493, + 493, 493, 452, 452, 426, 422, 426, 416, 416, 453, + 426, 426, 416, 416, 339, 525, 525, 525, 416, 426, + 436, 525, 525, 525, 525, 422, 525, 525, 422, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 422, + 424, 525, 499, 525, 468, 525, 525, 525, 525, 525, + 431, 525, 525, 525, 391, 334, 335, 336, 337, 338, + 340, 342, 344, 345, 346, 347, 348, 349, 350, 352, + 381, 382, 470, 471, 472, 492, 376, 490, 491, 420, + 429, 430, 439, 440, 451, 455, 456, 457, 398, 399, + 400, 401, 402, 421, 423, 425, 427, 431, 432, 433, + 407, 408, 409, 434, 437, 438, 465, 463, 502, 503, + 504, 505, 443, 444, 476, 469, 484, 351, 475, 521, + 522, 514, 515, 516, 519, 518, 520, 523, 524, 517, + 507, 509, 508, 506, 481, 466, 464, 462, 459, 460, + 461, 467, 482, 483, 428, 458, 496, 473, 468, 384, + 368, 392, 396, ); - const YYNOCODE = 109; + const YYNOCODE = 110; const YYSTACKDEPTH = 500; - const YYNSTATE = 332; - const YYNRULE = 191; + const YYNSTATE = 333; + const YYNRULE = 192; const YYERRORSYMBOL = 60; const YYERRSYMDT = 'yy0'; const YYFALLBACK = 0; @@ -1188,11 +1225,12 @@ public function PrintTrace() 'modifierlist', 'statement', 'statements', 'foraction', 'varvar', 'modparameters', 'attribute', 'nullcoalescing', 'ternary', 'tlop', 'lop', 'scond', - 'array', 'function', 'ns1', 'doublequoted_with_quotes', - 'static_class_access', 'arraydef', 'object', 'arrayindex', - 'indexdef', 'varvarele', 'objectchain', 'objectelement', - 'method', 'params', 'modifier', 'modparameter', - 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent', + 'isin', 'array', 'function', 'ns1', + 'doublequoted_with_quotes', 'static_class_access', 'arraydef', 'object', + 'arrayindex', 'indexdef', 'varvarele', 'objectchain', + 'objectelement', 'method', 'params', 'modifier', + 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', + 'doublequotedcontent', ); public static $yyRuleName = array( @@ -1271,8 +1309,9 @@ public function PrintTrace() 'expr ::= expr tlop value', 'expr ::= expr lop expr', 'expr ::= expr scond', - 'expr ::= expr ISIN array', - 'expr ::= expr ISIN value', + 'isin ::= ISIN', + 'expr ::= expr isin array', + 'expr ::= expr isin value', 'nullcoalescing ::= expr QMARK QMARK expr', 'ternary ::= expr QMARK DOLLARID COLON expr', 'ternary ::= expr QMARK value COLON expr', @@ -1777,6 +1816,7 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) array( 0 => 75, 1 => 3 ), array( 0 => 75, 1 => 3 ), array( 0 => 75, 1 => 2 ), + array( 0 => 88, 1 => 1 ), array( 0 => 75, 1 => 3 ), array( 0 => 75, 1 => 3 ), array( 0 => 83, 1 => 4 ), @@ -1807,8 +1847,8 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) array( 0 => 74, 1 => 1 ), array( 0 => 74, 1 => 1 ), array( 0 => 74, 1 => 3 ), - array( 0 => 90, 1 => 1 ), - array( 0 => 90, 1 => 1 ), + array( 0 => 91, 1 => 1 ), + array( 0 => 91, 1 => 1 ), array( 0 => 73, 1 => 1 ), array( 0 => 73, 1 => 1 ), array( 0 => 73, 1 => 3 ), @@ -1819,80 +1859,80 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) array( 0 => 73, 1 => 4 ), array( 0 => 70, 1 => 2 ), array( 0 => 70, 1 => 2 ), - array( 0 => 95, 1 => 2 ), - array( 0 => 95, 1 => 0 ), - array( 0 => 96, 1 => 2 ), - array( 0 => 96, 1 => 2 ), - array( 0 => 96, 1 => 4 ), - array( 0 => 96, 1 => 2 ), - array( 0 => 96, 1 => 2 ), - array( 0 => 96, 1 => 4 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 5 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 3 ), - array( 0 => 96, 1 => 3 ), array( 0 => 96, 1 => 2 ), + array( 0 => 96, 1 => 0 ), + array( 0 => 97, 1 => 2 ), + array( 0 => 97, 1 => 2 ), + array( 0 => 97, 1 => 4 ), + array( 0 => 97, 1 => 2 ), + array( 0 => 97, 1 => 2 ), + array( 0 => 97, 1 => 4 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 5 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 97, 1 => 2 ), array( 0 => 80, 1 => 1 ), array( 0 => 80, 1 => 1 ), array( 0 => 80, 1 => 2 ), - array( 0 => 97, 1 => 1 ), - array( 0 => 97, 1 => 1 ), - array( 0 => 97, 1 => 3 ), - array( 0 => 94, 1 => 2 ), array( 0 => 98, 1 => 1 ), - array( 0 => 98, 1 => 2 ), - array( 0 => 99, 1 => 3 ), - array( 0 => 99, 1 => 3 ), - array( 0 => 99, 1 => 5 ), - array( 0 => 99, 1 => 6 ), + array( 0 => 98, 1 => 1 ), + array( 0 => 98, 1 => 3 ), + array( 0 => 95, 1 => 2 ), + array( 0 => 99, 1 => 1 ), array( 0 => 99, 1 => 2 ), - array( 0 => 89, 1 => 4 ), - array( 0 => 100, 1 => 4 ), - array( 0 => 100, 1 => 4 ), - array( 0 => 101, 1 => 3 ), - array( 0 => 101, 1 => 1 ), - array( 0 => 101, 1 => 0 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 5 ), + array( 0 => 100, 1 => 6 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 90, 1 => 4 ), + array( 0 => 101, 1 => 4 ), + array( 0 => 101, 1 => 4 ), + array( 0 => 102, 1 => 3 ), + array( 0 => 102, 1 => 1 ), + array( 0 => 102, 1 => 0 ), array( 0 => 76, 1 => 3 ), array( 0 => 76, 1 => 2 ), - array( 0 => 102, 1 => 3 ), - array( 0 => 102, 1 => 2 ), - array( 0 => 81, 1 => 2 ), - array( 0 => 81, 1 => 0 ), - array( 0 => 103, 1 => 2 ), array( 0 => 103, 1 => 3 ), array( 0 => 103, 1 => 2 ), - array( 0 => 92, 1 => 1 ), - array( 0 => 92, 1 => 2 ), - array( 0 => 92, 1 => 1 ), - array( 0 => 92, 1 => 2 ), - array( 0 => 92, 1 => 3 ), + array( 0 => 81, 1 => 2 ), + array( 0 => 81, 1 => 0 ), + array( 0 => 104, 1 => 2 ), + array( 0 => 104, 1 => 3 ), + array( 0 => 104, 1 => 2 ), + array( 0 => 93, 1 => 1 ), + array( 0 => 93, 1 => 2 ), + array( 0 => 93, 1 => 1 ), + array( 0 => 93, 1 => 2 ), + array( 0 => 93, 1 => 3 ), array( 0 => 86, 1 => 1 ), array( 0 => 86, 1 => 1 ), array( 0 => 85, 1 => 1 ), array( 0 => 87, 1 => 1 ), - array( 0 => 93, 1 => 3 ), - array( 0 => 93, 1 => 3 ), - array( 0 => 104, 1 => 1 ), - array( 0 => 104, 1 => 3 ), - array( 0 => 104, 1 => 0 ), - array( 0 => 105, 1 => 3 ), - array( 0 => 105, 1 => 3 ), + array( 0 => 94, 1 => 3 ), + array( 0 => 94, 1 => 3 ), array( 0 => 105, 1 => 1 ), - array( 0 => 91, 1 => 2 ), - array( 0 => 91, 1 => 3 ), - array( 0 => 106, 1 => 2 ), + array( 0 => 105, 1 => 3 ), + array( 0 => 105, 1 => 0 ), + array( 0 => 106, 1 => 3 ), + array( 0 => 106, 1 => 3 ), array( 0 => 106, 1 => 1 ), - array( 0 => 107, 1 => 3 ), - array( 0 => 107, 1 => 3 ), - array( 0 => 107, 1 => 1 ), - array( 0 => 107, 1 => 3 ), - array( 0 => 107, 1 => 3 ), - array( 0 => 107, 1 => 1 ), + array( 0 => 92, 1 => 2 ), + array( 0 => 92, 1 => 3 ), + array( 0 => 107, 1 => 2 ), array( 0 => 107, 1 => 1 ), + array( 0 => 108, 1 => 3 ), + array( 0 => 108, 1 => 3 ), + array( 0 => 108, 1 => 1 ), + array( 0 => 108, 1 => 3 ), + array( 0 => 108, 1 => 3 ), + array( 0 => 108, 1 => 1 ), + array( 0 => 108, 1 => 1 ), ); public static $yyReduceMap = array( @@ -1912,18 +1952,18 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) 64 => 6, 65 => 6, 66 => 6, - 82 => 6, - 87 => 6, + 83 => 6, 88 => 6, - 93 => 6, - 97 => 6, + 89 => 6, + 94 => 6, 98 => 6, - 102 => 6, + 99 => 6, 103 => 6, - 105 => 6, - 110 => 6, - 174 => 6, - 179 => 6, + 104 => 6, + 106 => 6, + 111 => 6, + 175 => 6, + 180 => 6, 7 => 7, 8 => 8, 9 => 9, @@ -1963,18 +2003,18 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) 48 => 48, 49 => 49, 58 => 49, - 152 => 49, - 156 => 49, - 160 => 49, - 162 => 49, + 153 => 49, + 157 => 49, + 161 => 49, + 163 => 49, 50 => 50, - 153 => 50, - 159 => 50, + 154 => 50, + 160 => 50, 51 => 51, 52 => 52, 53 => 52, 54 => 54, - 137 => 54, + 138 => 54, 57 => 57, 59 => 59, 60 => 60, @@ -1994,56 +2034,56 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) 77 => 77, 78 => 78, 79 => 79, - 80 => 79, - 81 => 81, - 83 => 83, - 85 => 83, - 86 => 83, - 117 => 83, + 80 => 80, + 81 => 80, + 82 => 82, 84 => 84, - 89 => 89, + 86 => 84, + 87 => 84, + 118 => 84, + 85 => 85, 90 => 90, 91 => 91, 92 => 92, - 94 => 94, + 93 => 93, 95 => 95, - 96 => 95, - 99 => 99, + 96 => 96, + 97 => 96, 100 => 100, 101 => 101, - 104 => 104, - 106 => 106, + 102 => 102, + 105 => 105, 107 => 107, 108 => 108, 109 => 109, - 111 => 111, + 110 => 110, 112 => 112, 113 => 113, 114 => 114, 115 => 115, 116 => 116, - 118 => 118, - 176 => 118, + 117 => 117, 119 => 119, + 177 => 119, 120 => 120, 121 => 121, 122 => 122, 123 => 123, 124 => 124, - 132 => 124, 125 => 125, + 133 => 125, 126 => 126, 127 => 127, - 128 => 127, - 130 => 127, - 131 => 127, - 129 => 129, - 133 => 133, + 128 => 128, + 129 => 128, + 131 => 128, + 132 => 128, + 130 => 130, 134 => 134, 135 => 135, - 180 => 135, 136 => 136, - 138 => 138, + 181 => 136, + 137 => 137, 139 => 139, 140 => 140, 141 => 141, @@ -2057,12 +2097,12 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) 149 => 149, 150 => 150, 151 => 151, - 154 => 154, + 152 => 152, 155 => 155, - 157 => 157, + 156 => 156, 158 => 158, - 161 => 161, - 163 => 163, + 159 => 159, + 162 => 162, 164 => 164, 165 => 165, 166 => 166, @@ -2072,20 +2112,21 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) 170 => 170, 171 => 171, 172 => 172, - 173 => 172, - 175 => 175, - 177 => 177, + 173 => 173, + 174 => 173, + 176 => 176, 178 => 178, - 181 => 181, + 179 => 179, 182 => 182, 183 => 183, 184 => 184, - 187 => 184, 185 => 185, 188 => 185, 186 => 186, - 189 => 189, + 189 => 186, + 187 => 187, 190 => 190, + 191 => 191, ); // line 245 "src/Parser/TemplateParser.y" public function yy_r0(){ @@ -2409,50 +2450,59 @@ public function yy_r74(){ } // line 666 "src/Parser/TemplateParser.y" public function yy_r75(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; + static $isin = [ + 'isin' => 'in_array(', + 'isnotin' => '!in_array(', + ]; + $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $isin[$op]; } -// line 670 "src/Parser/TemplateParser.y" +// line 675 "src/Parser/TemplateParser.y" public function yy_r76(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; } -// line 675 "src/Parser/TemplateParser.y" +// line 679 "src/Parser/TemplateParser.y" public function yy_r77(){ - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?? '.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; } -// line 682 "src/Parser/TemplateParser.y" +// line 684 "src/Parser/TemplateParser.y" public function yy_r78(){ - $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?? '.$this->yystack[$this->yyidx + 0]->minor; } -// line 686 "src/Parser/TemplateParser.y" +// line 691 "src/Parser/TemplateParser.y" public function yy_r79(){ - $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; } // line 695 "src/Parser/TemplateParser.y" - public function yy_r81(){ + public function yy_r80(){ + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 704 "src/Parser/TemplateParser.y" + public function yy_r82(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?: '.$this->yystack[$this->yyidx + 0]->minor; } -// line 705 "src/Parser/TemplateParser.y" - public function yy_r83(){ +// line 714 "src/Parser/TemplateParser.y" + public function yy_r84(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 710 "src/Parser/TemplateParser.y" - public function yy_r84(){ +// line 719 "src/Parser/TemplateParser.y" + public function yy_r85(){ $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; } -// line 731 "src/Parser/TemplateParser.y" - public function yy_r89(){ +// line 740 "src/Parser/TemplateParser.y" + public function yy_r90(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 735 "src/Parser/TemplateParser.y" - public function yy_r90(){ +// line 744 "src/Parser/TemplateParser.y" + public function yy_r91(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; } -// line 739 "src/Parser/TemplateParser.y" - public function yy_r91(){ +// line 748 "src/Parser/TemplateParser.y" + public function yy_r92(){ $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 744 "src/Parser/TemplateParser.y" - public function yy_r92(){ +// line 753 "src/Parser/TemplateParser.y" + public function yy_r93(){ if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); @@ -2462,16 +2512,16 @@ public function yy_r92(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } } -// line 761 "src/Parser/TemplateParser.y" - public function yy_r94(){ +// line 770 "src/Parser/TemplateParser.y" + public function yy_r95(){ $this->_retvalue = '('. $this->yystack[$this->yyidx + -1]->minor .')'; } -// line 765 "src/Parser/TemplateParser.y" - public function yy_r95(){ +// line 774 "src/Parser/TemplateParser.y" + public function yy_r96(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 783 "src/Parser/TemplateParser.y" - public function yy_r99(){ +// line 792 "src/Parser/TemplateParser.y" + public function yy_r100(){ if ($this->security && $this->security->static_classes !== array()) { $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); } @@ -2483,19 +2533,19 @@ public function yy_r99(){ } $this->_retvalue = $prefixVar .'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; } -// line 797 "src/Parser/TemplateParser.y" - public function yy_r100(){ +// line 806 "src/Parser/TemplateParser.y" + public function yy_r101(){ $prefixVar = $this->compiler->getNewPrefixVariable(); $tmp = $this->compiler->appendCode('', $this->yystack[$this->yyidx + 0]->minor); $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); $this->_retvalue = $prefixVar; } -// line 804 "src/Parser/TemplateParser.y" - public function yy_r101(){ +// line 813 "src/Parser/TemplateParser.y" + public function yy_r102(){ $this->_retvalue = $this->compiler->compileModifier($this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 817 "src/Parser/TemplateParser.y" - public function yy_r104(){ +// line 826 "src/Parser/TemplateParser.y" + public function yy_r105(){ if (!in_array(strtolower($this->yystack[$this->yyidx + -2]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) { if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; @@ -2506,16 +2556,16 @@ public function yy_r104(){ $this->compiler->trigger_template_error ('static class \''.$this->yystack[$this->yyidx + -2]->minor.'\' is undefined or not allowed by security setting'); } } -// line 836 "src/Parser/TemplateParser.y" - public function yy_r106(){ +// line 845 "src/Parser/TemplateParser.y" + public function yy_r107(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 847 "src/Parser/TemplateParser.y" - public function yy_r107(){ +// line 856 "src/Parser/TemplateParser.y" + public function yy_r108(){ $this->_retvalue = $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''); } -// line 850 "src/Parser/TemplateParser.y" - public function yy_r108(){ +// line 859 "src/Parser/TemplateParser.y" + public function yy_r109(){ if ($this->yystack[$this->yyidx + 0]->minor['var'] === '\'smarty\'') { $smarty_var = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); $this->_retvalue = $smarty_var; @@ -2526,164 +2576,164 @@ public function yy_r108(){ $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; } } -// line 863 "src/Parser/TemplateParser.y" - public function yy_r109(){ +// line 872 "src/Parser/TemplateParser.y" + public function yy_r110(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 873 "src/Parser/TemplateParser.y" - public function yy_r111(){ +// line 882 "src/Parser/TemplateParser.y" + public function yy_r112(){ $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -1]->minor . '\''); } -// line 877 "src/Parser/TemplateParser.y" - public function yy_r112(){ +// line 886 "src/Parser/TemplateParser.y" + public function yy_r113(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -2]->minor . '\'') . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; } -// line 881 "src/Parser/TemplateParser.y" - public function yy_r113(){ +// line 890 "src/Parser/TemplateParser.y" + public function yy_r114(){ $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -1]->minor); } -// line 885 "src/Parser/TemplateParser.y" - public function yy_r114(){ +// line 894 "src/Parser/TemplateParser.y" + public function yy_r115(){ $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -2]->minor) . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; } -// line 889 "src/Parser/TemplateParser.y" - public function yy_r115(){ +// line 898 "src/Parser/TemplateParser.y" + public function yy_r116(){ $this->_retvalue = array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'', 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 892 "src/Parser/TemplateParser.y" - public function yy_r116(){ +// line 901 "src/Parser/TemplateParser.y" + public function yy_r117(){ $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } -// line 905 "src/Parser/TemplateParser.y" - public function yy_r118(){ +// line 914 "src/Parser/TemplateParser.y" + public function yy_r119(){ return; } -// line 911 "src/Parser/TemplateParser.y" - public function yy_r119(){ +// line 920 "src/Parser/TemplateParser.y" + public function yy_r120(){ $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\'').']'; } -// line 914 "src/Parser/TemplateParser.y" - public function yy_r120(){ +// line 923 "src/Parser/TemplateParser.y" + public function yy_r121(){ $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; } -// line 918 "src/Parser/TemplateParser.y" - public function yy_r121(){ +// line 927 "src/Parser/TemplateParser.y" + public function yy_r122(){ $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; } -// line 922 "src/Parser/TemplateParser.y" - public function yy_r122(){ +// line 931 "src/Parser/TemplateParser.y" + public function yy_r123(){ $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; } -// line 926 "src/Parser/TemplateParser.y" - public function yy_r123(){ +// line 935 "src/Parser/TemplateParser.y" + public function yy_r124(){ $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; } -// line 931 "src/Parser/TemplateParser.y" - public function yy_r124(){ +// line 940 "src/Parser/TemplateParser.y" + public function yy_r125(){ $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; } -// line 936 "src/Parser/TemplateParser.y" - public function yy_r125(){ +// line 945 "src/Parser/TemplateParser.y" + public function yy_r126(){ $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; } -// line 940 "src/Parser/TemplateParser.y" - public function yy_r126(){ +// line 949 "src/Parser/TemplateParser.y" + public function yy_r127(){ $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; } -// line 943 "src/Parser/TemplateParser.y" - public function yy_r127(){ +// line 952 "src/Parser/TemplateParser.y" + public function yy_r128(){ $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; } -// line 949 "src/Parser/TemplateParser.y" - public function yy_r129(){ +// line 958 "src/Parser/TemplateParser.y" + public function yy_r130(){ $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'').']'; } -// line 965 "src/Parser/TemplateParser.y" - public function yy_r133(){ +// line 974 "src/Parser/TemplateParser.y" + public function yy_r134(){ $this->_retvalue = '[]'; } -// line 975 "src/Parser/TemplateParser.y" - public function yy_r134(){ +// line 984 "src/Parser/TemplateParser.y" + public function yy_r135(){ $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; } -// line 979 "src/Parser/TemplateParser.y" - public function yy_r135(){ +// line 988 "src/Parser/TemplateParser.y" + public function yy_r136(){ $this->_retvalue = '\'\''; } -// line 984 "src/Parser/TemplateParser.y" - public function yy_r136(){ +// line 993 "src/Parser/TemplateParser.y" + public function yy_r137(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } -// line 992 "src/Parser/TemplateParser.y" - public function yy_r138(){ +// line 1001 "src/Parser/TemplateParser.y" + public function yy_r139(){ $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); $this->_retvalue = $this->compiler->compileVariable('\''.$var.'\''); } -// line 998 "src/Parser/TemplateParser.y" - public function yy_r139(){ +// line 1007 "src/Parser/TemplateParser.y" + public function yy_r140(){ $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 1005 "src/Parser/TemplateParser.y" - public function yy_r140(){ +// line 1014 "src/Parser/TemplateParser.y" + public function yy_r141(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] === '\'smarty\'') { $this->_retvalue = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; } else { $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; } } -// line 1014 "src/Parser/TemplateParser.y" - public function yy_r141(){ +// line 1023 "src/Parser/TemplateParser.y" + public function yy_r142(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -// line 1019 "src/Parser/TemplateParser.y" - public function yy_r142(){ +// line 1028 "src/Parser/TemplateParser.y" + public function yy_r143(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1024 "src/Parser/TemplateParser.y" - public function yy_r143(){ +// line 1033 "src/Parser/TemplateParser.y" + public function yy_r144(){ if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -// line 1031 "src/Parser/TemplateParser.y" - public function yy_r144(){ +// line 1040 "src/Parser/TemplateParser.y" + public function yy_r145(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1038 "src/Parser/TemplateParser.y" - public function yy_r145(){ +// line 1047 "src/Parser/TemplateParser.y" + public function yy_r146(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1045 "src/Parser/TemplateParser.y" - public function yy_r146(){ +// line 1054 "src/Parser/TemplateParser.y" + public function yy_r147(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -// line 1053 "src/Parser/TemplateParser.y" - public function yy_r147(){ +// line 1062 "src/Parser/TemplateParser.y" + public function yy_r148(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1061 "src/Parser/TemplateParser.y" - public function yy_r148(){ +// line 1070 "src/Parser/TemplateParser.y" + public function yy_r149(){ $this->_retvalue = $this->compiler->compileModifierInExpression($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor); } -// line 1069 "src/Parser/TemplateParser.y" - public function yy_r149(){ +// line 1078 "src/Parser/TemplateParser.y" + public function yy_r150(){ if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) === '_') { $this->compiler->trigger_template_error (self::ERR1); } $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . '('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1076 "src/Parser/TemplateParser.y" - public function yy_r150(){ +// line 1085 "src/Parser/TemplateParser.y" + public function yy_r151(){ if ($this->security) { $this->compiler->trigger_template_error (self::ERR2); } @@ -2691,56 +2741,56 @@ public function yy_r150(){ $this->compiler->appendPrefixCode("compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -3]->minor,1).'\'').';?>'); $this->_retvalue = $prefixVar .'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -// line 1087 "src/Parser/TemplateParser.y" - public function yy_r151(){ +// line 1096 "src/Parser/TemplateParser.y" + public function yy_r152(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); } -// line 1104 "src/Parser/TemplateParser.y" - public function yy_r154(){ +// line 1113 "src/Parser/TemplateParser.y" + public function yy_r155(){ $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 1108 "src/Parser/TemplateParser.y" - public function yy_r155(){ +// line 1117 "src/Parser/TemplateParser.y" + public function yy_r156(){ $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); } -// line 1116 "src/Parser/TemplateParser.y" - public function yy_r157(){ +// line 1125 "src/Parser/TemplateParser.y" + public function yy_r158(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } -// line 1124 "src/Parser/TemplateParser.y" - public function yy_r158(){ +// line 1133 "src/Parser/TemplateParser.y" + public function yy_r159(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } -// line 1137 "src/Parser/TemplateParser.y" - public function yy_r161(){ +// line 1146 "src/Parser/TemplateParser.y" + public function yy_r162(){ $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); } -// line 1146 "src/Parser/TemplateParser.y" - public function yy_r163(){ +// line 1155 "src/Parser/TemplateParser.y" + public function yy_r164(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method'); } -// line 1151 "src/Parser/TemplateParser.y" - public function yy_r164(){ +// line 1160 "src/Parser/TemplateParser.y" + public function yy_r165(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method'); } -// line 1156 "src/Parser/TemplateParser.y" - public function yy_r165(){ +// line 1165 "src/Parser/TemplateParser.y" + public function yy_r166(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, ''); } -// line 1161 "src/Parser/TemplateParser.y" - public function yy_r166(){ +// line 1170 "src/Parser/TemplateParser.y" + public function yy_r167(){ $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1166 "src/Parser/TemplateParser.y" - public function yy_r167(){ +// line 1175 "src/Parser/TemplateParser.y" + public function yy_r168(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor, 'property'); } -// line 1172 "src/Parser/TemplateParser.y" - public function yy_r168(){ +// line 1181 "src/Parser/TemplateParser.y" + public function yy_r169(){ $this->_retvalue = ' '. trim($this->yystack[$this->yyidx + 0]->minor) . ' '; } -// line 1176 "src/Parser/TemplateParser.y" - public function yy_r169(){ +// line 1185 "src/Parser/TemplateParser.y" + public function yy_r170(){ static $lops = array( 'eq' => ' == ', 'ne' => ' != ', @@ -2759,8 +2809,8 @@ public function yy_r169(){ $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $lops[$op]; } -// line 1195 "src/Parser/TemplateParser.y" - public function yy_r170(){ +// line 1204 "src/Parser/TemplateParser.y" + public function yy_r171(){ static $tlops = array( 'isdivby' => array('op' => ' % ', 'pre' => '!('), 'isnotdivby' => array('op' => ' % ', 'pre' => '('), @@ -2772,8 +2822,8 @@ public function yy_r170(){ $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $tlops[$op]; } -// line 1208 "src/Parser/TemplateParser.y" - public function yy_r171(){ +// line 1217 "src/Parser/TemplateParser.y" + public function yy_r172(){ static $scond = array ( 'iseven' => '!(1 & ', 'isnoteven' => '(1 & ', @@ -2783,54 +2833,54 @@ public function yy_r171(){ $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = $scond[$op]; } -// line 1222 "src/Parser/TemplateParser.y" - public function yy_r172(){ +// line 1231 "src/Parser/TemplateParser.y" + public function yy_r173(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } -// line 1233 "src/Parser/TemplateParser.y" - public function yy_r175(){ +// line 1242 "src/Parser/TemplateParser.y" + public function yy_r176(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } -// line 1241 "src/Parser/TemplateParser.y" - public function yy_r177(){ +// line 1250 "src/Parser/TemplateParser.y" + public function yy_r178(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1245 "src/Parser/TemplateParser.y" - public function yy_r178(){ +// line 1254 "src/Parser/TemplateParser.y" + public function yy_r179(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } -// line 1261 "src/Parser/TemplateParser.y" - public function yy_r181(){ +// line 1270 "src/Parser/TemplateParser.y" + public function yy_r182(){ $this->compiler->leaveDoubleQuote(); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php($this); } -// line 1267 "src/Parser/TemplateParser.y" - public function yy_r182(){ +// line 1276 "src/Parser/TemplateParser.y" + public function yy_r183(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -// line 1272 "src/Parser/TemplateParser.y" - public function yy_r183(){ +// line 1281 "src/Parser/TemplateParser.y" + public function yy_r184(){ $this->_retvalue = new Dq($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1276 "src/Parser/TemplateParser.y" - public function yy_r184(){ +// line 1285 "src/Parser/TemplateParser.y" + public function yy_r185(){ $this->_retvalue = new Code('(string)'.$this->yystack[$this->yyidx + -1]->minor); } -// line 1280 "src/Parser/TemplateParser.y" - public function yy_r185(){ +// line 1289 "src/Parser/TemplateParser.y" + public function yy_r186(){ $this->_retvalue = new Code('(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); } -// line 1284 "src/Parser/TemplateParser.y" - public function yy_r186(){ +// line 1293 "src/Parser/TemplateParser.y" + public function yy_r187(){ $this->_retvalue = new Code('(string)$_smarty_tpl->getValue(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')'); } -// line 1296 "src/Parser/TemplateParser.y" - public function yy_r189(){ +// line 1305 "src/Parser/TemplateParser.y" + public function yy_r190(){ $this->_retvalue = new Tag($this, $this->yystack[$this->yyidx + 0]->minor); } -// line 1300 "src/Parser/TemplateParser.y" - public function yy_r190(){ +// line 1309 "src/Parser/TemplateParser.y" + public function yy_r191(){ $this->_retvalue = new DqContent($this->yystack[$this->yyidx + 0]->minor); } diff --git a/src/Parser/TemplateParser.y b/src/Parser/TemplateParser.y index 68648196a..d01a42af3 100644 --- a/src/Parser/TemplateParser.y +++ b/src/Parser/TemplateParser.y @@ -663,12 +663,21 @@ expr(res) ::= expr(e1) scond(c). { res = c . e1 . ')'; } -expr(res) ::= expr(e1) ISIN array(a). { - res = 'in_array('.e1.','.a.')'; +isin(res) ::= ISIN(o). { + static $isin = [ + 'isin' => 'in_array(', + 'isnotin' => '!in_array(', + ]; + $op = strtolower(str_replace(' ', '', o)); + res = $isin[$op]; +} + +expr(res) ::= expr(e1) isin(c) array(a). { + res = c . e1.','.a.')'; } -expr(res) ::= expr(e1) ISIN value(v). { - res = 'in_array('.e1.',(array)'.v.')'; +expr(res) ::= expr(e1) isin(c) value(v). { + res = c . e1.',(array)'.v.')'; } // null coalescing diff --git a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php index 82ee97182..a45becc0f 100644 --- a/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/If/CompileIfTest.php @@ -169,6 +169,12 @@ public function dataTestIf() array('{if {counter start=1} == 1}yes{else}no{/if}', 'yes', 'Tag1', $i ++), array('{if false}false{elseif {counter start=1} == 1}yes{else}no{/if}', 'yes', 'Tag2', $i ++), array('{if {counter start=1} == 0}false{elseif {counter} == 2}yes{else}no{/if}', 'yes', 'Tag3', $i ++), + + array('{if 2 is in ["foo", 2]}yes{else}no{/if}', 'yes', 'IsIn', $i++), + array('{if 2 is in ["foo", "bar"]}yes{else}no{/if}', 'no', 'IsIn2', $i++), + array('{if 2 is not in ["foo", "bar"]}yes{else}no{/if}', 'yes', 'IsNotIn', $i++), + array('{if 2 is not in ["foo", 2]}yes{else}no{/if}', 'no', 'IsNotIn2', $i++), + ); } From 28e11b114b22d2ebe9d84a8cdc3e97dae1893a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=BChauf?= Date: Wed, 27 Mar 2024 11:47:42 +0100 Subject: [PATCH 5/9] Fix docblock information after Smarty 5 namespace changes (#968) --- src/TemplateBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TemplateBase.php b/src/TemplateBase.php index a2a420c07..4dab470f9 100644 --- a/src/TemplateBase.php +++ b/src/TemplateBase.php @@ -377,9 +377,9 @@ public function registerDefaultTemplateHandler($callback) { * Registers a resource to fetch a template * * @param string $name name of resource type - * @param Smarty\Resource\Base $resource_handler instance of Smarty\Resource\Base + * @param \Smarty\Resource\BasePlugin $resource_handler instance of Smarty\Resource\BasePlugin * - * @return \Smarty|\Smarty\Template + * @return \Smarty\Smarty|\Smarty\Template * @link https://www.smarty.net/docs/en/api.register.resource.tpl * * @api Smarty::registerResource() From a58d869502e270bc7d02d245f5e2022937a398aa Mon Sep 17 00:00:00 2001 From: Wim Wisselink Date: Wed, 27 Mar 2024 11:48:38 +0100 Subject: [PATCH 6/9] Deprecation fix for providing a non string value to ctype_digit (#960) --- src/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions.php b/src/functions.php index 5396ffcb9..590789ba3 100644 --- a/src/functions.php +++ b/src/functions.php @@ -66,7 +66,7 @@ function smarty_make_timestamp($string) || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface) ) { return (int)$string->format('U'); // PHP 5.2 BC - } elseif (strlen($string) === 14 && ctype_digit($string)) { + } elseif (strlen($string) === 14 && ctype_digit((string)$string)) { // it is mysql timestamp format of YYYYMMDDHHMMSS? return mktime( substr($string, 8, 2), From cafe5e1e59f3306fa4b05663b6292d1fc0865cad Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Wed, 27 Mar 2024 22:53:03 +0100 Subject: [PATCH 7/9] Fix missing and bogus use lines in src/Smarty.php. (#970) --- changelog/966.md | 1 + src/Smarty.php | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 changelog/966.md diff --git a/changelog/966.md b/changelog/966.md new file mode 100644 index 000000000..5332ce59c --- /dev/null +++ b/changelog/966.md @@ -0,0 +1 @@ +- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966) \ No newline at end of file diff --git a/src/Smarty.php b/src/Smarty.php index 6925d4060..0f6ee0ce7 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -2,6 +2,7 @@ namespace Smarty; +use FilesystemIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use Smarty\Cacheresource\File; @@ -12,11 +13,12 @@ use Smarty\Extension\DefaultExtension; use Smarty\Extension\ExtensionInterface; use Smarty\Filter\Output\TrimWhitespace; -use Smarty\Resource\BasePlugin; -use Smarty\Smarty\Runtime\CaptureRuntime; -use Smarty\Smarty\Runtime\ForeachRuntime; -use Smarty\Smarty\Runtime\InheritanceRuntime; -use Smarty\Smarty\Runtime\TplFunctionRuntime; +use Smarty\Runtime\CaptureRuntime; +use Smarty\Runtime\DefaultPluginHandlerRuntime; +use Smarty\Runtime\ForeachRuntime; +use Smarty\Runtime\InheritanceRuntime; +use Smarty\Runtime\TplFunctionRuntime; + /** * Project: Smarty: the PHP compiling template engine @@ -1755,15 +1757,15 @@ public function getRuntime(string $type) { // Lazy load runtimes when/if needed switch ($type) { case 'Capture': - return $this->runtimes[$type] = new \Smarty\Runtime\CaptureRuntime(); + return $this->runtimes[$type] = new CaptureRuntime(); case 'Foreach': - return $this->runtimes[$type] = new \Smarty\Runtime\ForeachRuntime(); + return $this->runtimes[$type] = new ForeachRuntime(); case 'Inheritance': - return $this->runtimes[$type] = new \Smarty\Runtime\InheritanceRuntime(); + return $this->runtimes[$type] = new InheritanceRuntime(); case 'TplFunction': - return $this->runtimes[$type] = new \Smarty\Runtime\TplFunctionRuntime(); + return $this->runtimes[$type] = new TplFunctionRuntime(); case 'DefaultPluginHandler': - return $this->runtimes[$type] = new \Smarty\Runtime\DefaultPluginHandlerRuntime( + return $this->runtimes[$type] = new DefaultPluginHandlerRuntime( $this->getDefaultPluginHandlerFunc() ); } @@ -2052,7 +2054,7 @@ public function unregisterFilter($type, $name) { * @param array|string $modifiers modifier or list of modifiers * to add * - * @return \Smarty|Template + * @return Smarty * @api Smarty::addDefaultModifiers() * */ @@ -2131,7 +2133,7 @@ public function fetch($template = null, $cache_id = null, $compile_id = null) { * @throws \Smarty\Exception */ public function display($template = null, $cache_id = null, $compile_id = null) { - return $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->display(); + $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->display(); } /** From 82a815aafb15a3ce89d04a625532523cfb971cc5 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Wed, 27 Mar 2024 22:57:04 +0100 Subject: [PATCH 8/9] version bump --- CHANGELOG.md | 4 ++++ changelog/966.md | 1 - src/Smarty.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 changelog/966.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 724651bc2..274c3b74a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.1] - 2024-03-27 +- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966) + + ## [5.0.0] - 2024-03-25 - Fixed that scoped variables would overwrite parent scope [#952](https://github.com/smarty-php/smarty/issues/952) - Removed publicly accessible `$tpl->_var_stack` variable diff --git a/changelog/966.md b/changelog/966.md deleted file mode 100644 index 5332ce59c..000000000 --- a/changelog/966.md +++ /dev/null @@ -1 +0,0 @@ -- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966) \ No newline at end of file diff --git a/src/Smarty.php b/src/Smarty.php index 0f6ee0ce7..bf1d3fad5 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -55,7 +55,7 @@ class Smarty extends \Smarty\TemplateBase { /** * smarty version */ - const SMARTY_VERSION = '5.0.0'; + const SMARTY_VERSION = '5.0.1'; /** * define caching modes From 71f79cfc8f9d6cb18e5c4a3bc6123170a28178b0 Mon Sep 17 00:00:00 2001 From: hoangnamitc Date: Thu, 28 Mar 2024 16:45:15 +0700 Subject: [PATCH 9/9] Fixed Call to a member function method() on null --- src/Data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data.php b/src/Data.php index 3176c7f05..582ee6601 100644 --- a/src/Data.php +++ b/src/Data.php @@ -109,7 +109,7 @@ public function assign($tpl_var, $value = null, $nocache = false, $scope = null) foreach ($tpl_var as $_key => $_val) { $this->assign($_key, $_val, $nocache, $scope); } - return; + return $this; } switch ($scope ?? $this->getDefaultScope()) { case self::SCOPE_GLOBAL: