update to smarty v3.1.24
authorStricted <info@stricted.de>
Sat, 23 May 2015 21:15:53 +0000 (23:15 +0200)
committerStricted <info@stricted.de>
Sat, 23 May 2015 21:15:53 +0000 (23:15 +0200)
30 files changed:
lib/api/smarty/Smarty.class.php
lib/api/smarty/debug.tpl
lib/api/smarty/plugins/block.lang.php
lib/api/smarty/plugins/outputfilter.trimwhitespace.php
lib/api/smarty/plugins/prefilter.hascontent.php
lib/api/smarty/smarty_version [deleted file]
lib/api/smarty/sysplugins/smarty_internal_compile_for.php
lib/api/smarty/sysplugins/smarty_internal_compile_foreach.php
lib/api/smarty/sysplugins/smarty_internal_compile_function.php
lib/api/smarty/sysplugins/smarty_internal_compile_if.php
lib/api/smarty/sysplugins/smarty_internal_compile_insert.php
lib/api/smarty/sysplugins/smarty_internal_compile_private_php.php
lib/api/smarty/sysplugins/smarty_internal_compile_private_special_variable.php
lib/api/smarty/sysplugins/smarty_internal_compile_while.php
lib/api/smarty/sysplugins/smarty_internal_configfilelexer.php
lib/api/smarty/sysplugins/smarty_internal_configfileparser.php
lib/api/smarty/sysplugins/smarty_internal_debug.php
lib/api/smarty/sysplugins/smarty_internal_extension_codeframe.php
lib/api/smarty/sysplugins/smarty_internal_extension_config.php
lib/api/smarty/sysplugins/smarty_internal_parsetree.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_code.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_dq.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_dqcontent.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_tag.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_template.php
lib/api/smarty/sysplugins/smarty_internal_parsetree_text.php
lib/api/smarty/sysplugins/smarty_internal_templatecompilerbase.php
lib/api/smarty/sysplugins/smarty_internal_templatelexer.php
lib/api/smarty/sysplugins/smarty_internal_templateparser.php
lib/api/smarty/sysplugins/smarty_security.php

index 0b168e8525b45dea239064ecc8e8005c104de7c4..82a87da8e9c4d4cd131bcf83246b3892fbc657b4 100644 (file)
@@ -111,21 +111,28 @@ class Smarty extends Smarty_Internal_TemplateBase
     /**
      * smarty version
      */
     /**
      * smarty version
      */
-    const SMARTY_VERSION = '3.1.23';
+    const SMARTY_VERSION = '3.1.24';
 
     /**
      * define variable scopes
      */
     const SCOPE_LOCAL = 0;
 
     /**
      * define variable scopes
      */
     const SCOPE_LOCAL = 0;
+
     const SCOPE_PARENT = 1;
     const SCOPE_PARENT = 1;
+
     const SCOPE_ROOT = 2;
     const SCOPE_ROOT = 2;
+
     const SCOPE_GLOBAL = 3;
     const SCOPE_GLOBAL = 3;
+
     /**
      * define caching modes
      */
     const CACHING_OFF = 0;
     /**
      * define caching modes
      */
     const CACHING_OFF = 0;
+
     const CACHING_LIFETIME_CURRENT = 1;
     const CACHING_LIFETIME_CURRENT = 1;
+
     const CACHING_LIFETIME_SAVED = 2;
     const CACHING_LIFETIME_SAVED = 2;
+
     /**
      * define constant for clearing cache files be saved expiration datees
      */
     /**
      * define constant for clearing cache files be saved expiration datees
      */
@@ -135,36 +142,53 @@ class Smarty extends Smarty_Internal_TemplateBase
      * define compile check modes
      */
     const COMPILECHECK_OFF = 0;
      * define compile check modes
      */
     const COMPILECHECK_OFF = 0;
+
     const COMPILECHECK_ON = 1;
     const COMPILECHECK_ON = 1;
+
     const COMPILECHECK_CACHEMISS = 2;
 
     /**
      * define debug modes
      */
     const DEBUG_OFF = 0;
     const COMPILECHECK_CACHEMISS = 2;
 
     /**
      * define debug modes
      */
     const DEBUG_OFF = 0;
+
     const DEBUG_ON = 1;
     const DEBUG_ON = 1;
+
     const DEBUG_INDIVIDUAL = 2;
     const DEBUG_INDIVIDUAL = 2;
+
     /**
      * modes for handling of "<?php ... ?>" tags in templates.
      */
     const PHP_PASSTHRU = 0; //-> print tags as plain text
     /**
      * modes for handling of "<?php ... ?>" tags in templates.
      */
     const PHP_PASSTHRU = 0; //-> print tags as plain text
+
     const PHP_QUOTE = 1; //-> escape tags as entities
     const PHP_QUOTE = 1; //-> escape tags as entities
+
     const PHP_REMOVE = 2; //-> escape tags as entities
     const PHP_REMOVE = 2; //-> escape tags as entities
+
     const PHP_ALLOW = 3; //-> escape tags as entities
     const PHP_ALLOW = 3; //-> escape tags as entities
+
     /**
      * filter types
      */
     const FILTER_POST = 'post';
     /**
      * filter types
      */
     const FILTER_POST = 'post';
+
     const FILTER_PRE = 'pre';
     const FILTER_PRE = 'pre';
+
     const FILTER_OUTPUT = 'output';
     const FILTER_OUTPUT = 'output';
+
     const FILTER_VARIABLE = 'variable';
     const FILTER_VARIABLE = 'variable';
+
     /**
      * plugin types
      */
     const PLUGIN_FUNCTION = 'function';
     /**
      * plugin types
      */
     const PLUGIN_FUNCTION = 'function';
+
     const PLUGIN_BLOCK = 'block';
     const PLUGIN_BLOCK = 'block';
+
     const PLUGIN_COMPILER = 'compiler';
     const PLUGIN_COMPILER = 'compiler';
+
     const PLUGIN_MODIFIER = 'modifier';
     const PLUGIN_MODIFIER = 'modifier';
+
     const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';
 
     /**#@-*/
     const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';
 
     /**#@-*/
@@ -178,23 +202,29 @@ class Smarty extends Smarty_Internal_TemplateBase
      * error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()
      */
     public static $_previous_error_handler = null;
      * error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors()
      */
     public static $_previous_error_handler = null;
+
     /**
      * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()
      */
     /**
      * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()
      */
-    public static $_muted_directories = array('./templates_c/' => null, './cache/' => null);
+    public static $_muted_directories = array('./templates_c/' => null,
+                                              './cache/'       => null);
+
     /**
      * Flag denoting if Multibyte String functions are available
      */
     public static $_MBSTRING = SMARTY_MBSTRING;
     /**
      * Flag denoting if Multibyte String functions are available
      */
     public static $_MBSTRING = SMARTY_MBSTRING;
+
     /**
      * The character set to adhere to (e.g. "UTF-8")
      */
     public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;
     /**
      * The character set to adhere to (e.g. "UTF-8")
      */
     public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;
+
     /**
      * The date format to be used internally
      * (accepts date() and strftime())
      */
     public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;
     /**
      * The date format to be used internally
      * (accepts date() and strftime())
      */
     public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;
+
     /**
      * Flag denoting if PCRE should run in UTF-8 mode
      */
     /**
      * Flag denoting if PCRE should run in UTF-8 mode
      */
@@ -215,132 +245,154 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var boolean
      */
     public $auto_literal = true;
      * @var boolean
      */
     public $auto_literal = true;
+
     /**
      * display error on not assigned variables
      *
      * @var boolean
      */
     public $error_unassigned = false;
     /**
      * display error on not assigned variables
      *
      * @var boolean
      */
     public $error_unassigned = false;
+
     /**
      * look up relative filepaths in include_path
      *
      * @var boolean
      */
     public $use_include_path = false;
     /**
      * look up relative filepaths in include_path
      *
      * @var boolean
      */
     public $use_include_path = false;
+
     /**
      * template directory
      *
      * @var array
      */
     private $template_dir = array('./templates/');
     /**
      * template directory
      *
      * @var array
      */
     private $template_dir = array('./templates/');
+
     /**
      * joined template directory string used in cache keys
      *
      * @var string
      */
     public $joined_template_dir = './templates/';
     /**
      * joined template directory string used in cache keys
      *
      * @var string
      */
     public $joined_template_dir = './templates/';
+
     /**
      * joined config directory string used in cache keys
      *
      * @var string
      */
     public $joined_config_dir = './configs/';
     /**
      * joined config directory string used in cache keys
      *
      * @var string
      */
     public $joined_config_dir = './configs/';
+
     /**
      * default template handler
      *
      * @var callable
      */
     public $default_template_handler_func = null;
     /**
      * default template handler
      *
      * @var callable
      */
     public $default_template_handler_func = null;
+
     /**
      * default config handler
      *
      * @var callable
      */
     public $default_config_handler_func = null;
     /**
      * default config handler
      *
      * @var callable
      */
     public $default_config_handler_func = null;
+
     /**
      * default plugin handler
      *
      * @var callable
      */
     public $default_plugin_handler_func = null;
     /**
      * default plugin handler
      *
      * @var callable
      */
     public $default_plugin_handler_func = null;
+
     /**
      * compile directory
      *
      * @var string
      */
     private $compile_dir = './templates_c/';
     /**
      * compile directory
      *
      * @var string
      */
     private $compile_dir = './templates_c/';
+
     /**
      * plugins directory
      *
      * @var array
      */
     private $plugins_dir = null;
     /**
      * plugins directory
      *
      * @var array
      */
     private $plugins_dir = null;
+
     /**
      * cache directory
      *
      * @var string
      */
     private $cache_dir = './cache/';
     /**
      * cache directory
      *
      * @var string
      */
     private $cache_dir = './cache/';
+
     /**
      * config directory
      *
      * @var array
      */
     private $config_dir = array('./configs/');
     /**
      * config directory
      *
      * @var array
      */
     private $config_dir = array('./configs/');
+
     /**
      * force template compiling?
      *
      * @var boolean
      */
     public $force_compile = false;
     /**
      * force template compiling?
      *
      * @var boolean
      */
     public $force_compile = false;
+
     /**
      * check template for modifications?
      *
      * @var boolean
      */
     public $compile_check = true;
     /**
      * check template for modifications?
      *
      * @var boolean
      */
     public $compile_check = true;
+
     /**
      * use sub dirs for compiled/cached files?
      *
      * @var boolean
      */
     public $use_sub_dirs = false;
     /**
      * use sub dirs for compiled/cached files?
      *
      * @var boolean
      */
     public $use_sub_dirs = false;
+
     /**
      * allow ambiguous resources (that are made unique by the resource handler)
      *
      * @var boolean
      */
     public $allow_ambiguous_resources = false;
     /**
      * allow ambiguous resources (that are made unique by the resource handler)
      *
      * @var boolean
      */
     public $allow_ambiguous_resources = false;
+
     /**
      * merge compiled includes
      *
      * @var boolean
      */
     public $merge_compiled_includes = false;
     /**
      * merge compiled includes
      *
      * @var boolean
      */
     public $merge_compiled_includes = false;
+
     /**
      * template inheritance merge compiled includes
      *
      * @var boolean
      */
     public $inheritance_merge_compiled_includes = true;
     /**
      * template inheritance merge compiled includes
      *
      * @var boolean
      */
     public $inheritance_merge_compiled_includes = true;
+
     /**
      * force cache file creation
      *
      * @var boolean
      */
     public $force_cache = false;
     /**
      * force cache file creation
      *
      * @var boolean
      */
     public $force_cache = false;
+
     /**
      * template left-delimiter
      *
      * @var string
      */
     public $left_delimiter = "{";
     /**
      * template left-delimiter
      *
      * @var string
      */
     public $left_delimiter = "{";
+
     /**
      * template right-delimiter
      *
      * @var string
      */
     public $right_delimiter = "}";
     /**
      * template right-delimiter
      *
      * @var string
      */
     public $right_delimiter = "}";
+
     /**#@+
      * security
      */
     /**#@+
      * security
      */
@@ -352,24 +404,28 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @see Smarty_Security
      */
     public $security_class = 'Smarty_Security';
      * @see Smarty_Security
      */
     public $security_class = 'Smarty_Security';
+
     /**
      * implementation of security class
      *
      * @var Smarty_Security
      */
     public $security_policy = null;
     /**
      * implementation of security class
      *
      * @var Smarty_Security
      */
     public $security_policy = null;
+
     /**
      * controls handling of PHP-blocks
      *
      * @var integer
      */
     public $php_handling = self::PHP_PASSTHRU;
     /**
      * controls handling of PHP-blocks
      *
      * @var integer
      */
     public $php_handling = self::PHP_PASSTHRU;
+
     /**
      * controls if the php template file resource is allowed
      *
      * @var bool
      */
     public $allow_php_templates = false;
     /**
      * controls if the php template file resource is allowed
      *
      * @var bool
      */
     public $allow_php_templates = false;
+
     /**
      * Should compiled-templates be prevented from being called directly?
      * {@internal
     /**
      * Should compiled-templates be prevented from being called directly?
      * {@internal
@@ -379,6 +435,7 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var boolean
      */
     public $direct_access_security = true;
      * @var boolean
      */
     public $direct_access_security = true;
+
     /**#@-*/
     /**
      * debug mode
     /**#@-*/
     /**
      * debug mode
@@ -387,6 +444,7 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var boolean
      */
     public $debugging = false;
      * @var boolean
      */
     public $debugging = false;
+
     /**
      * This determines if debugging is enable-able from the browser.
      * <ul>
     /**
      * This determines if debugging is enable-able from the browser.
      * <ul>
@@ -397,6 +455,7 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var string
      */
     public $debugging_ctrl = 'NONE';
      * @var string
      */
     public $debugging_ctrl = 'NONE';
+
     /**
      * Name of debugging URL-param.
      * Only used when $debugging_ctrl is set to 'URL'.
     /**
      * Name of debugging URL-param.
      * Only used when $debugging_ctrl is set to 'URL'.
@@ -405,12 +464,14 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var string
      */
     public $smarty_debug_id = 'SMARTY_DEBUG';
      * @var string
      */
     public $smarty_debug_id = 'SMARTY_DEBUG';
+
     /**
      * Path of debug template.
      *
      * @var string
      */
     public $debug_tpl = null;
     /**
      * Path of debug template.
      *
      * @var string
      */
     public $debug_tpl = null;
+
     /**
      * When set, smarty uses this value as error_reporting-level.
      *
     /**
      * When set, smarty uses this value as error_reporting-level.
      *
@@ -435,12 +496,14 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var boolean
      */
     public $config_overwrite = true;
      * @var boolean
      */
     public $config_overwrite = true;
+
     /**
      * Controls whether config values of on/true/yes and off/false/no get converted to boolean.
      *
      * @var boolean
      */
     public $config_booleanize = true;
     /**
      * Controls whether config values of on/true/yes and off/false/no get converted to boolean.
      *
      * @var boolean
      */
     public $config_booleanize = true;
+
     /**
      * Controls whether hidden config sections/vars are read from the file.
      *
     /**
      * Controls whether hidden config sections/vars are read from the file.
      *
@@ -460,12 +523,14 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var boolean
      */
     public $compile_locking = true;
      * @var boolean
      */
     public $compile_locking = true;
+
     /**
      * Controls whether cache resources should emply locking mechanism
      *
      * @var boolean
      */
     public $cache_locking = false;
     /**
      * Controls whether cache resources should emply locking mechanism
      *
      * @var boolean
      */
     public $cache_locking = false;
+
     /**
      * seconds to wait for acquiring a lock before ignoring the write lock
      *
     /**
      * seconds to wait for acquiring a lock before ignoring the write lock
      *
@@ -482,6 +547,7 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var string
      */
     public $default_resource_type = 'file';
      * @var string
      */
     public $default_resource_type = 'file';
+
     /**
      * caching type
      * Must be an element of $cache_resource_types.
     /**
      * caching type
      * Must be an element of $cache_resource_types.
@@ -489,24 +555,28 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var string
      */
     public $caching_type = 'file';
      * @var string
      */
     public $caching_type = 'file';
+
     /**
      * internal config properties
      *
      * @var array
      */
     public $properties = array();
     /**
      * internal config properties
      *
      * @var array
      */
     public $properties = array();
+
     /**
      * config type
      *
      * @var string
      */
     public $default_config_type = 'file';
     /**
      * config type
      *
      * @var string
      */
     public $default_config_type = 'file';
+
     /**
      * cached template objects
      *
      * @var array
      */
     public $source_objects = array();
     /**
      * cached template objects
      *
      * @var array
      */
     public $source_objects = array();
+
     /**
      * cached template objects
      *
     /**
      * cached template objects
      *
@@ -520,126 +590,150 @@ class Smarty extends Smarty_Internal_TemplateBase
      * @var bool
      */
     public $resource_caching = false;
      * @var bool
      */
     public $resource_caching = false;
+
     /**
      * enable template resource caching
      *
      * @var bool
      */
     public $template_resource_caching = true;
     /**
      * enable template resource caching
      *
      * @var bool
      */
     public $template_resource_caching = true;
+
     /**
      * check If-Modified-Since headers
      *
      * @var boolean
      */
     public $cache_modified_check = false;
     /**
      * check If-Modified-Since headers
      *
      * @var boolean
      */
     public $cache_modified_check = false;
+
     /**
      * registered plugins
      *
      * @var array
      */
     public $registered_plugins = array();
     /**
      * registered plugins
      *
      * @var array
      */
     public $registered_plugins = array();
+
     /**
      * plugin search order
      *
      * @var array
      */
     /**
      * plugin search order
      *
      * @var array
      */
-    public $plugin_search_order = array('function', 'block', 'compiler', 'class');
+    public $plugin_search_order = array('function',
+                                        'block',
+                                        'compiler',
+                                        'class');
+
     /**
      * registered objects
      *
      * @var array
      */
     public $registered_objects = array();
     /**
      * registered objects
      *
      * @var array
      */
     public $registered_objects = array();
+
     /**
      * registered classes
      *
      * @var array
      */
     public $registered_classes = array();
     /**
      * registered classes
      *
      * @var array
      */
     public $registered_classes = array();
+
     /**
      * registered filters
      *
      * @var array
      */
     public $registered_filters = array();
     /**
      * registered filters
      *
      * @var array
      */
     public $registered_filters = array();
+
     /**
      * registered resources
      *
      * @var array
      */
     public $registered_resources = array();
     /**
      * registered resources
      *
      * @var array
      */
     public $registered_resources = array();
+
     /**
      * resource handler cache
      *
      * @var array
      */
     public $_resource_handlers = array();
     /**
      * resource handler cache
      *
      * @var array
      */
     public $_resource_handlers = array();
+
     /**
      * registered cache resources
      *
      * @var array
      */
     public $registered_cache_resources = array();
     /**
      * registered cache resources
      *
      * @var array
      */
     public $registered_cache_resources = array();
+
     /**
      * cache resource handler cache
      *
      * @var array
      */
     public $_cacheresource_handlers = array();
     /**
      * cache resource handler cache
      *
      * @var array
      */
     public $_cacheresource_handlers = array();
+
     /**
      * autoload filter
      *
      * @var array
      */
     public $autoload_filters = array();
     /**
      * autoload filter
      *
      * @var array
      */
     public $autoload_filters = array();
+
     /**
      * default modifier
      *
      * @var array
      */
     public $default_modifiers = array();
     /**
      * default modifier
      *
      * @var array
      */
     public $default_modifiers = array();
+
     /**
      * autoescape variable output
      *
      * @var boolean
      */
     public $escape_html = false;
     /**
      * autoescape variable output
      *
      * @var boolean
      */
     public $escape_html = false;
+
     /**
      * global internal smarty vars
      *
      * @var array
      */
     public static $_smarty_vars = array();
     /**
      * global internal smarty vars
      *
      * @var array
      */
     public static $_smarty_vars = array();
+
     /**
      * start time for execution time calculation
      *
      * @var int
      */
     public $start_time = 0;
     /**
      * start time for execution time calculation
      *
      * @var int
      */
     public $start_time = 0;
+
     /**
      * default file permissions
      *
      * @var int
      */
     public $_file_perms = 0644;
     /**
      * default file permissions
      *
      * @var int
      */
     public $_file_perms = 0644;
+
     /**
      * default dir permissions
      *
      * @var int
      */
     public $_dir_perms = 0771;
     /**
      * default dir permissions
      *
      * @var int
      */
     public $_dir_perms = 0771;
+
     /**
      * block tag hierarchy
      *
      * @var array
      */
     public $_tag_stack = array();
     /**
      * block tag hierarchy
      *
      * @var array
      */
     public $_tag_stack = array();
+
     /**
      * required by the compiler for BC
      *
      * @var string
      */
     public $_current_file = null;
     /**
      * required by the compiler for BC
      *
      * @var string
      */
     public $_current_file = null;
+
     /**
      * internal flag to enable parser debugging
      *
     /**
      * internal flag to enable parser debugging
      *
@@ -658,7 +752,6 @@ class Smarty extends Smarty_Internal_TemplateBase
 
     /**
      * Initialize new Smarty object
 
     /**
      * Initialize new Smarty object
-
      */
     public function __construct()
     {
      */
     public function __construct()
     {
@@ -686,8 +779,6 @@ class Smarty extends Smarty_Internal_TemplateBase
         } else {
             $this->setPluginsDir(SMARTY_PLUGINS_DIR);
         }
         } else {
             $this->setPluginsDir(SMARTY_PLUGINS_DIR);
         }
-
-        $this->debug_tpl = 'file:' . dirname(__FILE__) . '/debug.tpl';
         if (isset($_SERVER['SCRIPT_NAME'])) {
             Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
         }
         if (isset($_SERVER['SCRIPT_NAME'])) {
             Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']);
         }
@@ -1283,9 +1374,7 @@ class Smarty extends Smarty_Internal_TemplateBase
             }
         }
         if ($this->debugging) {
             }
         }
         if ($this->debugging) {
-            if ($this->debugging) {
-                Smarty_Internal_Debug::register_template($tpl);
-            }
+            Smarty_Internal_Debug::register_template($tpl);
         }
         return $tpl;
     }
         }
         return $tpl;
     }
@@ -1331,10 +1420,8 @@ class Smarty extends Smarty_Internal_TemplateBase
 
         // loop through plugin dirs and find the plugin
         foreach ($this->getPluginsDir() as $_plugin_dir) {
 
         // loop through plugin dirs and find the plugin
         foreach ($this->getPluginsDir() as $_plugin_dir) {
-            $names = array(
-                $_plugin_dir . $_plugin_filename,
-                $_plugin_dir . strtolower($_plugin_filename),
-            );
+            $names = array($_plugin_dir . $_plugin_filename,
+                           $_plugin_dir . strtolower($_plugin_filename),);
             foreach ($names as $file) {
                 if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) {
                     require_once($file);
             foreach ($names as $file) {
                 if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) {
                     require_once($file);
@@ -1591,13 +1678,11 @@ class Smarty extends Smarty_Internal_TemplateBase
      */
     public function __get($name)
     {
      */
     public function __get($name)
     {
-        $allowed = array(
-            'template_dir' => 'getTemplateDir',
-            'config_dir'   => 'getConfigDir',
-            'plugins_dir'  => 'getPluginsDir',
-            'compile_dir'  => 'getCompileDir',
-            'cache_dir'    => 'getCacheDir',
-        );
+        $allowed = array('template_dir' => 'getTemplateDir',
+                         'config_dir'   => 'getConfigDir',
+                         'plugins_dir'  => 'getPluginsDir',
+                         'compile_dir'  => 'getCompileDir',
+                         'cache_dir'    => 'getCacheDir',);
 
         if (isset($allowed[$name])) {
             return $this->{$allowed[$name]}();
 
         if (isset($allowed[$name])) {
             return $this->{$allowed[$name]}();
@@ -1616,13 +1701,11 @@ class Smarty extends Smarty_Internal_TemplateBase
      */
     public function __set($name, $value)
     {
      */
     public function __set($name, $value)
     {
-        $allowed = array(
-            'template_dir' => 'setTemplateDir',
-            'config_dir'   => 'setConfigDir',
-            'plugins_dir'  => 'setPluginsDir',
-            'compile_dir'  => 'setCompileDir',
-            'cache_dir'    => 'setCacheDir',
-        );
+        $allowed = array('template_dir' => 'setTemplateDir',
+                         'config_dir'   => 'setConfigDir',
+                         'plugins_dir'  => 'setPluginsDir',
+                         'compile_dir'  => 'setCompileDir',
+                         'cache_dir'    => 'setCacheDir',);
 
         if (isset($allowed[$name])) {
             $this->{$allowed[$name]}($value);
 
         if (isset($allowed[$name])) {
             $this->{$allowed[$name]}($value);
@@ -1652,10 +1735,8 @@ class Smarty extends Smarty_Internal_TemplateBase
         if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
             $smarty_dir = realpath(SMARTY_DIR);
             if ($smarty_dir !== false) {
         if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
             $smarty_dir = realpath(SMARTY_DIR);
             if ($smarty_dir !== false) {
-                Smarty::$_muted_directories[SMARTY_DIR] = array(
-                    'file'   => $smarty_dir,
-                    'length' => strlen($smarty_dir),
-                );
+                Smarty::$_muted_directories[SMARTY_DIR] = array('file'   => $smarty_dir,
+                                                                'length' => strlen($smarty_dir),);
             }
         }
 
             }
         }
 
@@ -1669,10 +1750,8 @@ class Smarty extends Smarty_Internal_TemplateBase
                     unset(Smarty::$_muted_directories[$key]);
                     continue;
                 }
                     unset(Smarty::$_muted_directories[$key]);
                     continue;
                 }
-                $dir = array(
-                    'file'   => $file,
-                    'length' => strlen($file),
-                );
+                $dir = array('file'   => $file,
+                             'length' => strlen($file),);
             }
             if (!strncmp($errfile, $dir['file'], $dir['length'])) {
                 $_is_muted_directory = true;
             }
             if (!strncmp($errfile, $dir['file'], $dir['length'])) {
                 $_is_muted_directory = true;
@@ -1714,7 +1793,8 @@ class Smarty extends Smarty_Internal_TemplateBase
                 - between file_exists() and filemtime() a possible race condition is opened,
                   which does not exist using the simple @filemtime() approach.
         */
                 - between file_exists() and filemtime() a possible race condition is opened,
                   which does not exist using the simple @filemtime() approach.
         */
-        $error_handler = array('Smarty', 'mutingErrorHandler');
+        $error_handler = array('Smarty',
+                               'mutingErrorHandler');
         $previous = set_error_handler($error_handler);
 
         // avoid dead loops
         $previous = set_error_handler($error_handler);
 
         // avoid dead loops
index 464727b6e1745617505517bfd5602abee2b552b9..5b09c5bd2518420ca85fca66634fd617eb63bca6 100644 (file)
     </head>
     <body>
 
     </head>
     <body>
 
-    <h1>Smarty Debug Console
+    <h1>Smarty {Smarty::SMARTY_VERSION} Debug Console
         -  {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
 
     {if !empty($template_data)}
         -  {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
 
     {if !empty($template_data)}
     <table id="table_assigned_vars">
         {foreach $assigned_vars as $vars}
             <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
     <table id="table_assigned_vars">
         {foreach $assigned_vars as $vars}
             <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
-                <td><h3><font color=blue>${$vars@key|escape:'html'}</font></h3>
+                <td><h3><font color=blue>${$vars@key}</font></h3>
                     {if isset($vars['nocache'])}<b>Nocache</b></br>{/if}
                     {if isset($vars['nocache'])}<b>Nocache</b></br>{/if}
-                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']}{/if}
+                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var:10:80 nofilter}{/if}
                 </td>
                 </td>
-                <td><h3>Value</h3>{$vars['value']|debug_print_var nofilter}</td>
+                <td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td>
                 <td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>
          {/foreach}
     </table>
                 <td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>
          {/foreach}
     </table>
     <table id="table_config_vars">
         {foreach $config_vars as $vars}
             <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
     <table id="table_config_vars">
         {foreach $config_vars as $vars}
             <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
-                <td><h3><font color=blue>#{$vars@key|escape:'html'}#</font></h3>
-                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']}{/if}
+                <td><h3><font color=blue>#{$vars@key}#</font></h3>
+                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var:10:80 nofilter}{/if}
                 </td>
                 </td>
-                <td>{$vars['value']|debug_print_var nofilter}</td>
+                <td>{$vars['value']|debug_print_var:10:80 nofilter}</td>
             </tr>
         {/foreach}
 
             </tr>
         {/foreach}
 
index 46ed598d58be2a0cf48a4ccc8bca3bf6a86fe96a..e869450bdf5edac2350644fd4c93130b00c31e42 100644 (file)
@@ -1,39 +1,39 @@
-<?php\r
-/**\r
- * Smarty plugin to format text blocks\r
- *\r
- * @author      Jan Altensen (Stricted)\r
- * @copyright   2013-2015 Jan Altensen (Stricted)\r
- * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>\r
- * @package     Smarty\r
- * @subpackage  PluginsBlock\r
- */\r
-\r
-/**\r
- * Smarty {lang}{/lang} block plugin\r
- */\r
-function smarty_block_lang($params, $content, $template, &$repeat) {\r
-       if (is_null($content) || empty($content)) {\r
-               return;\r
-       }\r
-       \r
-       $lang = $template->smarty->getTemplateVars('language');\r
-       \r
-       if (is_null($lang)) {\r
-               return $content;\r
-       }\r
-       \r
-       $content = str_replace(array("'", '"'), "", $content);\r
-       \r
-       if (isset($lang[$content])) {\r
-               if (strpos($lang[$content], $template->smarty->left_delimiter) !== false && strpos($lang[$content], $template->smarty->right_delimiter) !== false) {\r
-                       $data = str_replace("\$", '$', $lang[$content]);\r
-                       $_template = new $template->smarty->template_class('eval:'.$data, $template->smarty, $template);\r
-                       return $_template->fetch();\r
-               }\r
-               \r
-               return $lang[$content];\r
-       }\r
-       \r
-       return $content;\r
-}\r
+<?php
+/**
+ * Smarty plugin to format text blocks
+ *
+ * @author      Jan Altensen (Stricted)
+ * @copyright   2013-2015 Jan Altensen (Stricted)
+ * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package     Smarty
+ * @subpackage  PluginsBlock
+ */
+
+/**
+ * Smarty {lang}{/lang} block plugin
+ */
+function smarty_block_lang($params, $content, $template, &$repeat) {
+       if (is_null($content) || empty($content)) {
+               return;
+       }
+       
+       $lang = $template->smarty->getTemplateVars('language');
+       
+       if (is_null($lang)) {
+               return $content;
+       }
+       
+       $content = str_replace(array("'", '"'), "", $content);
+       
+       if (isset($lang[$content])) {
+               if (strpos($lang[$content], $template->smarty->left_delimiter) !== false && strpos($lang[$content], $template->smarty->right_delimiter) !== false) {
+                       $data = str_replace("\$", '$', $lang[$content]);
+                       $_template = new $template->smarty->template_class('eval:'.$data, $template->smarty, $template);
+                       return $_template->fetch();
+               }
+               
+               return $lang[$content];
+       }
+       
+       return $content;
+}
index 62ab4e776aa3143d34d86dcf827d7cf366d9d3bc..ad35d11a2558461b6acc096e0733e9cec70ffa0c 100644 (file)
@@ -45,7 +45,7 @@ function smarty_outputfilter_trimwhitespace($source)
 
     // capture html elements not to be messed with
     $_offset = 0;
 
     // capture html elements not to be messed with
     $_offset = 0;
-    if (preg_match_all('#<(script|pre|textarea)[^>]*>.*?</\\1>#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
+    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
         foreach ($matches as $match) {
             $store[] = $match[0][0];
             $_length = strlen($match[0][0]);
         foreach ($matches as $match) {
             $store[] = $match[0][0];
             $_length = strlen($match[0][0]);
@@ -62,7 +62,7 @@ function smarty_outputfilter_trimwhitespace($source)
         // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements
         '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s'                            => '\1 \2',
         // remove spaces between attributes (but not in attribute values!)
         // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements
         '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s'                            => '\1 \2',
         // remove spaces between attributes (but not in attribute values!)
-        '#(([a-z0-9]\s*=\s*(["\'])[^\3]*?\3)|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \4',
+        '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5',
         // note: for some very weird reason trim() seems to remove spaces inside attributes.
         // maybe a \0 byte or something is interfering?
         '#^\s+<#Ss'                                                       => '<',
         // note: for some very weird reason trim() seems to remove spaces inside attributes.
         // maybe a \0 byte or something is interfering?
         '#^\s+<#Ss'                                                       => '<',
index 9123688d2941a42d5b1b62c545c5e416fabf545b..304995465da4b057dcdafeb457dfb517db0c1d7c 100644 (file)
@@ -1,55 +1,55 @@
-<?php\r
-/**\r
- * Template prefiler plugin which allows inserting code dynamically upon the contents\r
- * of 'content'.\r
- * \r
- * Usage:\r
- *     {hascontent}\r
- *     <ul>\r
- *             {content}\r
- *                     {if $foo}<li>bar</li>{/if}\r
- *             {/content}\r
- *     </ul>\r
- *     {hascontentelse}\r
- *             <p>baz</p>\r
- *     {/hascontent}\r
- * \r
- * @author     Alexander Ebert\r
- * @copyright  2001-2014 WoltLab GmbH\r
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>\r
- * @package    com.woltlab.wcf\r
- * @subpackage system.template.plugin\r
- * @category   Community Framework\r
- */\r
-\r
-function smarty_prefilter_hascontent($source, &$smarty) {\r
-       $ldq = preg_quote($smarty->left_delimiter, '~');\r
-       $rdq = preg_quote($smarty->right_delimiter, '~');\r
-       \r
-       $source = preg_replace_callback("~{$ldq}hascontent( assign='(?P<assign>.*)')?{$rdq}(?P<before>.*){$ldq}content{$rdq}(?P<content>.*){$ldq}\/content{$rdq}(?P<after>.*)({$ldq}hascontentelse{$rdq}(?P<else>.*))?{$ldq}\/hascontent{$rdq}~sU", function ($matches) {\r
-               $beforeContent = $matches['before'];\r
-               $content = $matches['content'];\r
-               $afterContent = $matches['after'];\r
-               $elseContent = (isset($matches['else'])) ? $matches['else'] : '';\r
-               $assignContent = (isset($matches['assign']) && !empty($matches['assign'])) ? $matches['assign'] : '';\r
-               $variable = 'hascontent_' . sha1(time());\r
-               \r
-               $newContent = '{capture assign='.$variable.'}'.$content.'{/capture}'."\n";\r
-               $newContent .= '{assign var='.$variable.' value=$'.$variable.'|trim}'."\n";\r
-               \r
-               if ($assignContent) $newContent .= '{capture assign='.$assignContent.'}'."\n";\r
-               $newContent .= '{if $'.$variable.'}'.$beforeContent.'{$'.$variable.'}'."\n".$afterContent;\r
-               \r
-               if (!empty($elseContent)) {\r
-                       $newContent .= '{else}'.$elseContent."\n";\r
-               }\r
-               \r
-               $newContent .= '{/if}'."\n";\r
-               \r
-               if ($assignContent) $newContent .= "{/capture}\n{\$".$assignContent."}\n";\r
-               \r
-               return $newContent;\r
-       }, $source);\r
-       \r
-       return $source;\r
-}\r
+<?php
+/**
+ * Template prefiler plugin which allows inserting code dynamically upon the contents
+ * of 'content'.
+ * 
+ * Usage:
+ *     {hascontent}
+ *     <ul>
+ *             {content}
+ *                     {if $foo}<li>bar</li>{/if}
+ *             {/content}
+ *     </ul>
+ *     {hascontentelse}
+ *             <p>baz</p>
+ *     {/hascontent}
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2014 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.template.plugin
+ * @category   Community Framework
+ */
+
+function smarty_prefilter_hascontent($source, &$smarty) {
+       $ldq = preg_quote($smarty->left_delimiter, '~');
+       $rdq = preg_quote($smarty->right_delimiter, '~');
+       
+       $source = preg_replace_callback("~{$ldq}hascontent( assign='(?P<assign>.*)')?{$rdq}(?P<before>.*){$ldq}content{$rdq}(?P<content>.*){$ldq}\/content{$rdq}(?P<after>.*)({$ldq}hascontentelse{$rdq}(?P<else>.*))?{$ldq}\/hascontent{$rdq}~sU", function ($matches) {
+               $beforeContent = $matches['before'];
+               $content = $matches['content'];
+               $afterContent = $matches['after'];
+               $elseContent = (isset($matches['else'])) ? $matches['else'] : '';
+               $assignContent = (isset($matches['assign']) && !empty($matches['assign'])) ? $matches['assign'] : '';
+               $variable = 'hascontent_' . sha1(time());
+               
+               $newContent = '{capture assign='.$variable.'}'.$content.'{/capture}'."\n";
+               $newContent .= '{assign var='.$variable.' value=$'.$variable.'|trim}'."\n";
+               
+               if ($assignContent) $newContent .= '{capture assign='.$assignContent.'}'."\n";
+               $newContent .= '{if $'.$variable.'}'.$beforeContent.'{$'.$variable.'}'."\n".$afterContent;
+               
+               if (!empty($elseContent)) {
+                       $newContent .= '{else}'.$elseContent."\n";
+               }
+               
+               $newContent .= '{/if}'."\n";
+               
+               if ($assignContent) $newContent .= "{/capture}\n{\$".$assignContent."}\n";
+               
+               return $newContent;
+       }, $source);
+       
+       return $source;
+}
diff --git a/lib/api/smarty/smarty_version b/lib/api/smarty/smarty_version
deleted file mode 100644 (file)
index fac63b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-3.1.23
\ No newline at end of file
index a624b922c9e5c78a1861b788641ce8cb5dd5ec57..5bac5501137b3740f6d2759d38b6d3e23b0916fa 100644 (file)
@@ -47,27 +47,48 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase
         $output = "<?php ";
         if ($parameter == 1) {
             foreach ($_attr['start'] as $_statement) {
         $output = "<?php ";
         if ($parameter == 1) {
             foreach ($_attr['start'] as $_statement) {
-                $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
-                $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value];\n";
+                if (is_array($_statement['var'])) {
+                    $var = $_statement['var']['var'];
+                    $index = $_statement['var']['smarty_internal_index'];
+                } else {
+                    $var = $_statement['var'];
+                    $index = '';
+                }
+                $output .= " \$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable;";
+                $output .= " \$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value];\n";
             }
             }
-            $output .= "  if ($_attr[ifexp]) { for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[var]]->value$_attr[step]) {\n";
+            if (is_array($_attr['var'])) {
+                $var = $_attr['var']['var'];
+                $index = $_attr['var']['smarty_internal_index'];
+            } else {
+                $var = $_attr['var'];
+                $index = '';
+            }
+            $output .= "  if ($_attr[ifexp]) { for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$var]->value{$index}$_attr[step]) {\n";
         } else {
             $_statement = $_attr['start'];
         } else {
             $_statement = $_attr['start'];
-            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
+            if (is_array($_statement['var'])) {
+                $var = $_statement['var']['var'];
+                $index = $_statement['var']['smarty_internal_index'];
+            } else {
+                $var = $_statement['var'];
+                $index = '';
+            }
+            $output .= "\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable;";
             if (isset($_attr['step'])) {
             if (isset($_attr['step'])) {
-                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = $_attr[step];";
+                $output .= "\$_smarty_tpl->tpl_vars[$var]->step = $_attr[step];";
             } else {
             } else {
-                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = 1;";
+                $output .= "\$_smarty_tpl->tpl_vars[$var]->step = 1;";
             }
             if (isset($_attr['max'])) {
             }
             if (isset($_attr['max'])) {
-                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int) min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n";
+                $output .= "\$_smarty_tpl->tpl_vars[$var]->total = (int) min(ceil((\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$var]->step)),$_attr[max]);\n";
             } else {
             } else {
-                $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int) ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n";
+                $output .= "\$_smarty_tpl->tpl_vars[$var]->total = (int) ceil((\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$var]->step));\n";
             }
             }
-            $output .= "if (\$_smarty_tpl->tpl_vars[$_statement[var]]->total > 0) {\n";
-            $output .= "for (\$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value], \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration = 1;\$_smarty_tpl->tpl_vars[$_statement[var]]->iteration <= \$_smarty_tpl->tpl_vars[$_statement[var]]->total;\$_smarty_tpl->tpl_vars[$_statement[var]]->value += \$_smarty_tpl->tpl_vars[$_statement[var]]->step, \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration++) {\n";
-            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->first = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == 1;";
-            $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->last = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == \$_smarty_tpl->tpl_vars[$_statement[var]]->total;";
+            $output .= "if (\$_smarty_tpl->tpl_vars[$var]->total > 0) {\n";
+            $output .= "for (\$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value], \$_smarty_tpl->tpl_vars[$var]->iteration = 1;\$_smarty_tpl->tpl_vars[$var]->iteration <= \$_smarty_tpl->tpl_vars[$var]->total;\$_smarty_tpl->tpl_vars[$var]->value{$index} += \$_smarty_tpl->tpl_vars[$var]->step, \$_smarty_tpl->tpl_vars[$var]->iteration++) {\n";
+            $output .= "\$_smarty_tpl->tpl_vars[$var]->first = \$_smarty_tpl->tpl_vars[$var]->iteration == 1;";
+            $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration == \$_smarty_tpl->tpl_vars[$var]->total;";
         }
         $output .= "?>";
 
         }
         $output .= "?>";
 
index e117a4a109948f0688a45054148aad2753904087..82ea496372c42e7044e550a6c4e0033008f72c8c 100644 (file)
@@ -208,7 +208,8 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase
                 }
             }
         }
                 }
             }
         }
-        $output .= "\$foreachItemSav = \$_smarty_tpl->tpl_vars[$item];\n";
+        $itemName = trim($item,"'\"");
+        $output .= "\$foreach_{$itemName}_Sav = \$_smarty_tpl->tpl_vars[$item];\n";
         $output .= "?>";
 
         return $output;
         $output .= "?>";
 
         return $output;
@@ -239,8 +240,9 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase
 
         list($openTag, $nocache, $item, $key, $foo) = $this->closeTag($compiler, array('foreach'));
         $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $item, $key, false));
 
         list($openTag, $nocache, $item, $key, $foo) = $this->closeTag($compiler, array('foreach'));
         $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $item, $key, false));
+        $itemName = trim($item,"'\"");
         $output = "<?php\n";
         $output = "<?php\n";
-        $output .= "\$_smarty_tpl->tpl_vars[$item] = \$foreachItemSav;\n";
+        $output .= "\$_smarty_tpl->tpl_vars[$item] = \$foreach_{$itemName}_Sav;\n";
         $output .= "}\n";
         $output .= "if (!\$_smarty_tpl->tpl_vars[$item]->_loop) {\n?>";
         return $output;
         $output .= "}\n";
         $output .= "if (!\$_smarty_tpl->tpl_vars[$item]->_loop) {\n?>";
         return $output;
@@ -274,9 +276,10 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase
         }
 
         list($openTag, $compiler->nocache, $item, $key, $restore) = $this->closeTag($compiler, array('foreach', 'foreachelse'));
         }
 
         list($openTag, $compiler->nocache, $item, $key, $restore) = $this->closeTag($compiler, array('foreach', 'foreachelse'));
+        $itemName = trim($item,"'\"");
         $output = "<?php\n";
         if ($restore) {
         $output = "<?php\n";
         if ($restore) {
-            $output .= "\$_smarty_tpl->tpl_vars[$item] = \$foreachItemSav;\n";
+            $output .= "\$_smarty_tpl->tpl_vars[$item] = \$foreach_{$itemName}_Sav;\n";
         }
         $output .= "}\n?>";
 
         }
         $output .= "}\n?>";
 
index 57054851644ed4f9f1f7276b2759ad9aace3a508..35408bcbea51755f118b3a2ccb9c042fdf291b96 100644 (file)
@@ -16,6 +16,7 @@
  */
 class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
 {
  */
 class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
 {
+
     /**
      * Attribute definition: Overwrites base class.
      *
     /**
      * Attribute definition: Overwrites base class.
      *
@@ -23,6 +24,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
      * @see Smarty_Internal_CompileBase
      */
     public $required_attributes = array('name');
      * @see Smarty_Internal_CompileBase
      */
     public $required_attributes = array('name');
+
     /**
      * Attribute definition: Overwrites base class.
      *
     /**
      * Attribute definition: Overwrites base class.
      *
@@ -30,6 +32,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
      * @see Smarty_Internal_CompileBase
      */
     public $shorttag_order = array('name');
      * @see Smarty_Internal_CompileBase
      */
     public $shorttag_order = array('name');
+
     /**
      * Attribute definition: Overwrites base class.
      *
     /**
      * Attribute definition: Overwrites base class.
      *
@@ -57,9 +60,8 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
         }
         unset($_attr['nocache']);
         $_name = trim($_attr['name'], "'\"");
         }
         unset($_attr['nocache']);
         $_name = trim($_attr['name'], "'\"");
-
-        $save = array($_attr, $compiler->parser->current_buffer,
-                      $compiler->template->has_nocache_code, $compiler->template->required_plugins, $compiler->template->caching);
+        $compiler->parent_compiler->templateProperties['tpl_function'][$_name] = array();
+        $save = array($_attr, $compiler->parser->current_buffer, $compiler->template->has_nocache_code, $compiler->template->required_plugins, $compiler->template->caching);
         $this->openTag($compiler, 'function', $save);
         // set flag that we are compiling a template function
         $compiler->compiles_template_function = true;
         $this->openTag($compiler, 'function', $save);
         // set flag that we are compiling a template function
         $compiler->compiles_template_function = true;
@@ -80,6 +82,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
  */
 class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
 {
  */
 class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
 {
+
     /**
      * Compiler object
      *
     /**
      * Compiler object
      *
@@ -90,11 +93,11 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
     /**
      * Compiles code for the {/function} tag
      *
     /**
      * Compiles code for the {/function} tag
      *
-     * @param  array  $args      array with attributes from parser
-     * @param  object $compiler  compiler object
-     * @param  array  $parameter array with compilation parameter
+     * @param  array                                       $args      array with attributes from parser
+     * @param object|\Smarty_Internal_TemplateCompilerBase $compiler  compiler object
+     * @param  array                                       $parameter array with compilation parameter
      *
      *
-     * @return boolean true
+     * @return bool true
      */
     public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
     {
      */
     public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
     {
index 26c0acc755f593350da7c772c63887b32c962b92..d4fd30e9fa2def82236656804d864c04d71995fa 100644 (file)
@@ -42,9 +42,14 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
+                    $var = trim($parameter['if condition']['var']['var'], "'");
                 } else {
                 } else {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
+                    $var = trim($parameter['if condition']['var'], "'");
+                 }
+                if (isset($compiler->template->tpl_vars[$var])) {
+                    $compiler->template->tpl_vars[$var]->nocache = true;
+                } else {
+                    $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true);
                 }
             } else {
                 $_nocache = '';
                 }
             } else {
                 $_nocache = '';
@@ -124,9 +129,14 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
+                    $var = trim($parameter['if condition']['var']['var'], "'");
+                } else {
+                    $var = trim($parameter['if condition']['var'], "'");
+                }
+                if (isset($compiler->template->tpl_vars[$var])) {
+                    $compiler->template->tpl_vars[$var]->nocache = true;
                 } else {
                 } else {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
+                    $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true);
                 }
             } else {
                 $_nocache = '';
                 }
             } else {
                 $_nocache = '';
@@ -155,22 +165,23 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase
         } else {
             $tmp = '';
             foreach ($compiler->prefix_code as $code) {
         } else {
             $tmp = '';
             foreach ($compiler->prefix_code as $code) {
-                $tmp .= $code;
-            }
+                $tmp = $compiler->appendCode($tmp, $code);
+           }
             $compiler->prefix_code = array();
             $compiler->prefix_code = array();
+            $tmp = $compiler->appendCode("<?php } else {?>", $tmp);
             $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));
             if ($condition_by_assign) {
                 if (is_array($parameter['if condition']['var'])) {
             $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));
             if ($condition_by_assign) {
                 if (is_array($parameter['if condition']['var'])) {
-                    $_output = "<?php } else {?>{$tmp}<?php  if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n";
+                    $_output = $compiler->appendCode($tmp, "<?php  if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n");
                     $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>";
                 } else {
                     $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>";
                 } else {
-                    $_output = "<?php } else {?>{$tmp}<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});";
+                    $_output = $compiler->appendCode($tmp, "<?php if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});");
                     $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>";
                 }
 
                 return $_output;
             } else {
                     $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>";
                 }
 
                 return $_output;
             } else {
-                return "<?php } else {?>{$tmp}<?php if ({$parameter['if condition']}) {?>";
+                return $compiler->appendCode($tmp, "<?php if ({$parameter['if condition']}) {?>");
             }
         }
     }
             }
         }
     }
index 659b3f12056cd3549142d79465b4d63d5225bc11..57f2735067e79ba6be55ed69b30213d030cde6b5 100644 (file)
@@ -68,7 +68,12 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
             // output will be stored in a smarty variable instead of being displayed
             $_assign = $_attr['assign'];
             // create variable to make sure that the compiler knows about its nocache status
             // output will be stored in a smarty variable instead of being displayed
             $_assign = $_attr['assign'];
             // create variable to make sure that the compiler knows about its nocache status
-            $compiler->template->tpl_vars[trim($_attr['assign'], "'")] = new Smarty_Variable(null, true);
+            $var = trim($_attr['assign'], "'");
+            if (isset($compiler->template->tpl_vars[$var])) {
+                $compiler->template->tpl_vars[$var]->nocache = true;
+            } else {
+                $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true);
+            }
         }
         if (isset($_attr['script'])) {
             // script which must be included
         }
         if (isset($_attr['script'])) {
             // script which must be included
index 1b5652a11cd7ba35cea7f657027c0c45dfa70051..4211bca9acf33b31c90957311dc3707cc3066232 100644 (file)
@@ -16,6 +16,7 @@
  */
 class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
 {
  */
 class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
 {
+
     /**
      * Attribute definition: Overwrites base class.
      *
     /**
      * Attribute definition: Overwrites base class.
      *
@@ -39,28 +40,30 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
         // check and get attributes
         $_attr = $this->getAttributes($compiler, $args);
         $compiler->has_code = false;
         // check and get attributes
         $_attr = $this->getAttributes($compiler, $args);
         $compiler->has_code = false;
-        $this->asp_tags = (ini_get('asp_tags') != '0');
-        if ($_attr['type'] == 'tag' && !($compiler->smarty instanceof SmartyBC)) {
-            $compiler->trigger_template_error('{php}[/php} tags not allowed. Use SmartyBC to enable them', $compiler->lex->taglineno);
+        if ($_attr['type'] == 'xml') {
+            $compiler->tag_nocache = true;
+            $save = $compiler->template->has_nocache_code;
+            $compiler->template->has_nocache_code = $save;
+            $output = addcslashes($_attr['code'], "'\\");
+            $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true)));
+            return '';
         }
         if ($_attr['type'] != 'tag') {
         }
         if ($_attr['type'] != 'tag') {
-            if (isset($compiler->smarty->security_policy)) {
-                $this->php_handling = $compiler->smarty->security_policy->php_handling;
-            } else {
-                $this->php_handling = $compiler->smarty->php_handling;
-            }
-            if ($this->php_handling == Smarty::PHP_REMOVE) {
-                $output = preg_replace(array('#^(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)#', '#(\?>)|(%>)|(<\/script>)$#'), '', $_attr['code']);
-                $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Text($compiler->parser, $output));
+             if ($compiler->php_handling == Smarty::PHP_REMOVE) {
                 return '';
                 return '';
-            } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
-                $output = preg_replace_callback(array('#^(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)#', '#(\?>)|(%>)|(<\/script>)$#'), function ($match) {return htmlspecialchars($match[0], ENT_QUOTES);}, $_attr['code']);
+            } elseif ($compiler->php_handling == Smarty::PHP_QUOTE) {
+                $output = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this,
+                    'quote'), $_attr['code']);
                 $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Text($compiler->parser, $output));
                 return '';
                 $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Text($compiler->parser, $output));
                 return '';
-            } elseif ($this->php_handling == Smarty::PHP_PASSTHRU || ($_attr['type'] == 'asp' && !$this->asp_tags) || $_attr['type'] == 'unmatched') {
-                $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Text($compiler->parser, $_attr['code']));
+            } elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr['type'] == 'unmatched') {
+                $compiler->tag_nocache = true;
+                $save = $compiler->template->has_nocache_code;
+                $compiler->template->has_nocache_code = $save;
+                $output = addcslashes($_attr['code'], "'\\");
+                $compiler->parser->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" . $output . "';?>", $compiler, true)));
                 return '';
                 return '';
-            } elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+            } elseif ($compiler->php_handling == Smarty::PHP_ALLOW) {
                 if (!($compiler->smarty instanceof SmartyBC)) {
                     $compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it', $compiler->lex->taglineno);
                 }
                 if (!($compiler->smarty instanceof SmartyBC)) {
                     $compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it', $compiler->lex->taglineno);
                 }
@@ -71,14 +74,12 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
             }
         } else {
             $compiler->has_code = true;
             }
         } else {
             $compiler->has_code = true;
+            if (!($compiler->smarty instanceof SmartyBC)) {
+                $compiler->trigger_template_error('{php}[/php} tags not allowed. Use SmartyBC to enable them', $compiler->lex->taglineno);
+            }
             $ldel = preg_quote($compiler->smarty->left_delimiter, '#');
             $rdel = preg_quote($compiler->smarty->right_delimiter, '#');
             $ldel = preg_quote($compiler->smarty->left_delimiter, '#');
             $rdel = preg_quote($compiler->smarty->right_delimiter, '#');
-            if (!preg_match("#{$ldel}\\s*/\\s*php\\s*{$rdel}$#", $_attr['code'], $match)) {
-                $compiler->trigger_template_error('Missing {/php} closing tag', $compiler->lex->taglineno);
-            }
-            if (!preg_match("#^({$ldel}\\s*php\\s*)((.)*?)({$rdel})#", $_attr['code'], $match)) {
-                $compiler->trigger_template_error('Missing {php} open tag', $compiler->lex->taglineno);
-            }
+            preg_match("#^({$ldel}php\\s*)((.)*?)({$rdel})#", $_attr['code'], $match);
             if (!empty($match[2])) {
                 if ('nocache' == trim($match[2])) {
                     $compiler->tag_nocache = true;
             if (!empty($match[2])) {
                 if ('nocache' == trim($match[2])) {
                     $compiler->tag_nocache = true;
@@ -86,7 +87,103 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
                     $compiler->trigger_template_error("illegal value of option flag \"{$match[2]}\"", $compiler->lex->taglineno);
                 }
             }
                     $compiler->trigger_template_error("illegal value of option flag \"{$match[2]}\"", $compiler->lex->taglineno);
                 }
             }
-            return preg_replace(array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#", "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"), array('<?php ', '?>'), $_attr['code']);
+            return preg_replace(array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#",
+                                    "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"), array('<?php ', '?>'), $_attr['code']);
         }
     }
         }
     }
+
+    /**
+     * Lexer code for PHP tags
+     *
+     * This code has been moved from lexer here fo easier debugging and maintenance
+     *
+     * @param $lex
+     */
+    public function parsePhp($lex)
+    {
+        $close = 0;
+        $lex->taglineno = $lex->line;
+        $closeTag = '?>';
+        if (strpos($lex->value, '<?xml') === 0) {
+            $lex->phpType = 'xml';
+        } elseif (strpos($lex->value, '<?') === 0) {
+            $lex->phpType = 'php';
+        } elseif (strpos($lex->value, '<%') === 0) {
+            $lex->phpType = 'asp';
+            $closeTag = '%>';
+        } elseif (strpos($lex->value, '%>') === 0) {
+            $lex->phpType = 'unmatched';
+        } elseif (strpos($lex->value, '?>') === 0) {
+            $lex->phpType = 'unmatched';
+        } elseif (strpos($lex->value, '<s') === 0) {
+            $lex->phpType = 'script';
+            $closeTag = '</script>';
+        } elseif (strpos($lex->value, $lex->smarty->left_delimiter) === 0) {
+            if ($lex->isAutoLiteral()) {
+                $lex->token = Smarty_Internal_Templateparser::TP_TEXT;
+                return;
+            }
+            $closeTag = "{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}";
+            if ($lex->value == $closeTag) {
+                $lex->compiler->trigger_template_error("unexpected closing tag '{$closeTag}'");
+            }
+            $lex->phpType = 'tag';
+        }
+        if ($lex->phpType == 'unmatched') {
+            return;
+        }
+        if (($lex->phpType == 'php' || $lex->phpType == 'asp') && ($lex->compiler->php_handling == Smarty::PHP_PASSTHRU || $lex->compiler->php_handling == Smarty::PHP_QUOTE)) {
+            return;
+        }
+        $start = $lex->counter + strlen($lex->value);
+        $body = true;
+        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {
+            $close = $match[0][1];
+        } else {
+            $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'");
+        }
+        while ($body) {
+            if (preg_match('~([/][*])|([/][/][^\n]*)|(\'[^\'\\\\]*(?:\\.[^\'\\\\]*)*\')|("[^"\\\\]*(?:\\.[^"\\\\]*)*")~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {
+                $value = $match[0][0];
+                $from = $pos = $match[0][1];
+                if ($pos > $close) {
+                    $body = false;
+                } else {
+                    $start = $pos + strlen($value);
+                    $phpCommentStart = $value == '/*';
+                    if ($phpCommentStart) {
+                        $phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start);
+                        if ($phpCommentEnd) {
+                            $pos2 = $match[0][1];
+                            $start = $pos2 + strlen($match[0][0]);
+                        }
+                    }
+                    while ($close > $pos && $close < $start) {
+                        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $from)) {
+                            $close = $match[0][1];
+                            $from = $close + strlen($match[0][0]);
+                        } else {
+                            $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'");
+                        }
+                    }
+                    if ($phpCommentStart && (!$phpCommentEnd || $pos2 > $close)) {
+                        $lex->taglineno = $lex->line + substr_count(substr($lex->data, $lex->counter, $start), "\n");
+                        $lex->compiler->trigger_template_error("missing PHP comment closing tag '*/'");
+                    }
+                }
+            } else {
+                $body = false;
+            }
+        }
+        $lex->value = substr($lex->data, $lex->counter, $close + strlen($closeTag) - $lex->counter);
+    }
+
+    /*
+     * Call back function for $php_handling = PHP_QUOTE
+     *
+     */
+    private function quote($match)
+    {
+        return htmlspecialchars($match[0], ENT_QUOTES);
+    }
 }
 }
index 0a98127e4d6685ec565b5daff7f93ecbec993ffd..525bc0db73be881f188dbc2387e86696d4fe81b4 100644 (file)
@@ -35,7 +35,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
                 case 'foreach':
                     $name = trim($_index[1], "'");
                     $foreachVar = "'__foreach_{$name}'";
                 case 'foreach':
                     $name = trim($_index[1], "'");
                     $foreachVar = "'__foreach_{$name}'";
-                    return "isset(\$_smarty_tpl->tpl_vars[$foreachVar]->value[{$_index[2]}]) ? \$_smarty_tpl->tpl_vars[$foreachVar]->value[{$_index[2]}] : null";
+                    return "(isset(\$_smarty_tpl->tpl_vars[$foreachVar]->value[{$_index[2]}]) ? \$_smarty_tpl->tpl_vars[$foreachVar]->value[{$_index[2]}] : null)";
                 case 'section':
                     return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
                 case 'capture':
                 case 'section':
                     return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
                 case 'capture':
@@ -82,7 +82,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
                         $compiler->trigger_template_error("(secure mode) constants not permitted");
                         break;
                     }
                         $compiler->trigger_template_error("(secure mode) constants not permitted");
                         break;
                     }
-                    if (strpos($_index[1], '$') === false) {
+                    if (strpos($_index[1], '$') === false && strpos($_index[1], '\'') === false ) {
                         return "@constant('{$_index[1]}')";
                     } else {
                         return "@constant({$_index[1]})";
                         return "@constant('{$_index[1]}')";
                     } else {
                         return "@constant({$_index[1]})";
index b73602f3fa1296c40bc65aabd6610f60b096b5c7..6a6fb3ef1cb1dc7b445bb87ac2b7ad8350ab2f10 100644 (file)
@@ -42,9 +42,14 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
                 $_nocache = ',true';
                 // create nocache var to make it know for further compiling
                 if (is_array($parameter['if condition']['var'])) {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_Variable(null, true);
+                    $var = trim($parameter['if condition']['var']['var'], "'");
                 } else {
                 } else {
-                    $compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_Variable(null, true);
+                    $var = trim($parameter['if condition']['var'], "'");
+                }
+                if (isset($compiler->template->tpl_vars[$var])) {
+                    $compiler->template->tpl_vars[$var]->nocache = true;
+                } else {
+                    $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true);
                 }
             } else {
                 $_nocache = '';
                 }
             } else {
                 $_nocache = '';
index 3e08c9dfd684043b148c304c59ba46939eac62c6..e5d4770b0ae007d31300f752a7c3f7269bd81408 100644 (file)
 <?php
 /**
 <?php
 /**
-* Smarty Internal Plugin Configfilelexer
-*
-* This is the lexer to break the config file source into tokens 
-* @package Smarty
-* @subpackage Config
-* @author Uwe Tews 
-*/
+ * Smarty Internal Plugin Configfilelexer
+ *
+ * This is the lexer to break the config file source into tokens
+ *
+ * @package    Smarty
+ * @subpackage Config
+ * @author     Uwe Tews
+ */
+
 /**
 /**
-* Smarty_Internal_Configfilelexer
-*
-* This is the config file lexer.
-* It is generated from the smarty_internal_configfilelexer.plex file
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty_Internal_Configfilelexer
+ *
+ * This is the config file lexer.
+ * It is generated from the smarty_internal_configfilelexer.plex file
+ *
+ * @package    Smarty
+ * @subpackage Compiler
+ * @author     Uwe Tews
+ */
 class Smarty_Internal_Configfilelexer
 {
 class Smarty_Internal_Configfilelexer
 {
+
     /**
      * Source
      *
      * @var string
      */
     public $data;
     /**
      * Source
      *
      * @var string
      */
     public $data;
+
     /**
      * byte counter
      *
      * @var int
      */
     public $counter;
     /**
      * byte counter
      *
      * @var int
      */
     public $counter;
+
     /**
      * token number
      *
      * @var int
      */
     public $token;
     /**
      * token number
      *
      * @var int
      */
     public $token;
+
     /**
      * token value
      *
      * @var string
      */
     public $value;
     /**
      * token value
      *
      * @var string
      */
     public $value;
+
     /**
      * current line
      *
      * @var int
      */
     public $line;
     /**
      * current line
      *
      * @var int
      */
     public $line;
+
     /**
      * state number
      *
      * @var int
      */
     public $state = 1;
     /**
      * state number
      *
      * @var int
      */
     public $state = 1;
+
     /**
      * Smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
     /**
      * Smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
+
     /**
      * compiler object
      *
      * @var Smarty_Internal_Config_File_Compiler
      */
     private $compiler = null;
     /**
      * compiler object
      *
      * @var Smarty_Internal_Config_File_Compiler
      */
     private $compiler = null;
+
     /**
      * copy of config_booleanize
      *
      * @var bool
      */
     private $configBooleanize = false;
     /**
      * copy of config_booleanize
      *
      * @var bool
      */
     private $configBooleanize = false;
+
     /**
      * trace file
      *
      * @var resource
      */
     public $yyTraceFILE;
     /**
      * trace file
      *
      * @var resource
      */
     public $yyTraceFILE;
+
     /**
      * trace prompt
      *
      * @var string
      */
     public $yyTracePrompt;
     /**
      * trace prompt
      *
      * @var string
      */
     public $yyTracePrompt;
+
     /**
      * state names
      *
      * @var array
      */
     public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE');
     /**
      * state names
      *
      * @var array
      */
     public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE');
+
+    /**
+     * storage for assembled token patterns
+     *
+     * @var sring
+     */
+    private $yy_global_pattern1 = null;
+
+    private $yy_global_pattern2 = null;
+
+    private $yy_global_pattern3 = null;
+
+    private $yy_global_pattern4 = null;
+
+    private $yy_global_pattern5 = null;
+
+    private $yy_global_pattern6 = null;
+
     /**
      * token names
      *
     /**
      * token names
      *
@@ -135,9 +167,8 @@ class Smarty_Internal_Configfilelexer
         $this->yyTracePrompt = '<br>';
     }
 
         $this->yyTracePrompt = '<br>';
     }
 
-
-
     private $_yy_state = 1;
     private $_yy_state = 1;
+
     private $_yy_stack = array();
 
     public function yylex()
     private $_yy_stack = array();
 
     public function yylex()
@@ -148,75 +179,54 @@ class Smarty_Internal_Configfilelexer
     public function yypushstate($state)
     {
         if ($this->yyTraceFILE) {
     public function yypushstate($state)
     {
         if ($this->yyTraceFILE) {
-             fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
+            fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
         }
         array_push($this->_yy_stack, $this->_yy_state);
         $this->_yy_state = $state;
         if ($this->yyTraceFILE) {
         }
         array_push($this->_yy_stack, $this->_yy_state);
         $this->_yy_state = $state;
         if ($this->yyTraceFILE) {
-             fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
+            fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
         }
     }
 
     public function yypopstate()
     {
         }
     }
 
     public function yypopstate()
     {
-       if ($this->yyTraceFILE) {
-             fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt,  isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
+        if ($this->yyTraceFILE) {
+            fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
         }
         }
-       $this->_yy_state = array_pop($this->_yy_stack);
+        $this->_yy_state = array_pop($this->_yy_stack);
         if ($this->yyTraceFILE) {
         if ($this->yyTraceFILE) {
-             fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
+            fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
         }
         }
-
     }
 
     public function yybegin($state)
     {
     }
 
     public function yybegin($state)
     {
-       $this->_yy_state = $state;
+        $this->_yy_state = $state;
         if ($this->yyTraceFILE) {
         if ($this->yyTraceFILE) {
-             fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
+            fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
         }
     }
 
         }
     }
 
-
-
-
     public function yylex1()
     {
     public function yylex1()
     {
-        $tokenMap = array (
-              1 => 0,
-              2 => 0,
-              3 => 0,
-              4 => 0,
-              5 => 0,
-              6 => 0,
-              7 => 0,
-              8 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern1)) {
+            $this->yy_global_pattern1 = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state START');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state START');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r1_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -229,106 +239,92 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const START = 1;
     const START = 1;
-    function yy_r1_1($yy_subpatterns)
-    {
 
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;
-    $this->yypushstate(self::COMMENT);
-    }
-    function yy_r1_2($yy_subpatterns)
+    function yy_r1_1()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;
-    $this->yypushstate(self::SECTION);
+        $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;
+        $this->yypushstate(self::COMMENT);
     }
     }
-    function yy_r1_3($yy_subpatterns)
+
+    function yy_r1_2()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;
+        $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;
+        $this->yypushstate(self::SECTION);
     }
     }
-    function yy_r1_4($yy_subpatterns)
+
+    function yy_r1_3()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;
-    $this->yypushstate(self::VALUE);
+        $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;
     }
     }
-    function yy_r1_5($yy_subpatterns)
+
+    function yy_r1_4()
     {
 
     {
 
-    return false;
+        $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;
+        $this->yypushstate(self::VALUE);
     }
     }
-    function yy_r1_6($yy_subpatterns)
+
+    function yy_r1_5()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
+        return false;
     }
     }
-    function yy_r1_7($yy_subpatterns)
+
+    function yy_r1_6()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_ID;
+        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
     }
     }
-    function yy_r1_8($yy_subpatterns)
+
+    function yy_r1_7()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
+        $this->token = Smarty_Internal_Configfileparser::TPC_ID;
     }
 
     }
 
+    function yy_r1_8()
+    {
 
 
+        $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
+    }
 
     public function yylex2()
     {
 
     public function yylex2()
     {
-        $tokenMap = array (
-              1 => 0,
-              2 => 0,
-              3 => 0,
-              4 => 0,
-              5 => 0,
-              6 => 0,
-              7 => 0,
-              8 => 0,
-              9 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern2)) {
+            $this->yy_global_pattern2 = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state VALUE');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state VALUE');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r2_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -341,115 +337,110 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const VALUE = 2;
     const VALUE = 2;
-    function yy_r2_1($yy_subpatterns)
-    {
 
 
-    return false;
-    }
-    function yy_r2_2($yy_subpatterns)
+    function yy_r2_1()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;
-    $this->yypopstate();
+        return false;
     }
     }
-    function yy_r2_3($yy_subpatterns)
+
+    function yy_r2_2()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_INT;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;
+        $this->yypopstate();
     }
     }
-    function yy_r2_4($yy_subpatterns)
+
+    function yy_r2_3()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;
-    $this->yypushstate(self::TRIPPLE);
+        $this->token = Smarty_Internal_Configfileparser::TPC_INT;
+        $this->yypopstate();
     }
     }
-    function yy_r2_5($yy_subpatterns)
+
+    function yy_r2_4()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;
+        $this->yypushstate(self::TRIPPLE);
     }
     }
-    function yy_r2_6($yy_subpatterns)
+
+    function yy_r2_5()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;
+        $this->yypopstate();
     }
     }
-    function yy_r2_7($yy_subpatterns)
+
+    function yy_r2_6()
     {
 
     {
 
-    if (!$this->configBooleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no")) ) {
-        $this->yypopstate();
-        $this->yypushstate(self::NAKED_STRING_VALUE);
-        return true; //reprocess in new state
-    } else {
-        $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;
+        $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;
         $this->yypopstate();
     }
         $this->yypopstate();
     }
-    }
-    function yy_r2_8($yy_subpatterns)
+
+    function yy_r2_7()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
-    $this->yypopstate();
+        if (!$this->configBooleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no"))) {
+            $this->yypopstate();
+            $this->yypushstate(self::NAKED_STRING_VALUE);
+            return true; //reprocess in new state
+        } else {
+            $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;
+            $this->yypopstate();
+        }
     }
     }
-    function yy_r2_9($yy_subpatterns)
+
+    function yy_r2_8()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
-    $this->value = "";
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+        $this->yypopstate();
     }
 
     }
 
+    function yy_r2_9()
+    {
 
 
+        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+        $this->value = "";
+        $this->yypopstate();
+    }
 
     public function yylex3()
     {
 
     public function yylex3()
     {
-        $tokenMap = array (
-              1 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern3)) {
+            $this->yy_global_pattern3 = "/\G([^\n]+?(?=[ \t\r]*\n))/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G([^\n]+?(?=[ \t\r]*\n))/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state NAKED_STRING_VALUE');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state NAKED_STRING_VALUE');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r3_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -462,63 +453,48 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const NAKED_STRING_VALUE = 3;
     const NAKED_STRING_VALUE = 3;
-    function yy_r3_1($yy_subpatterns)
+
+    function yy_r3_1()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+        $this->yypopstate();
     }
 
     }
 
-
-
     public function yylex4()
     {
     public function yylex4()
     {
-        $tokenMap = array (
-              1 => 0,
-              2 => 0,
-              3 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern4)) {
+            $this->yy_global_pattern4 = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state COMMENT');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state COMMENT');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r4_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -531,72 +507,60 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const COMMENT = 4;
     const COMMENT = 4;
-    function yy_r4_1($yy_subpatterns)
-    {
 
 
-    return false;
-    }
-    function yy_r4_2($yy_subpatterns)
+    function yy_r4_1()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
+        return false;
     }
     }
-    function yy_r4_3($yy_subpatterns)
+
+    function yy_r4_2()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
     }
 
     }
 
+    function yy_r4_3()
+    {
 
 
+        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
+        $this->yypopstate();
+    }
 
     public function yylex5()
     {
 
     public function yylex5()
     {
-        $tokenMap = array (
-              1 => 0,
-              2 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern5)) {
+            $this->yy_global_pattern5 = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state SECTION');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state SECTION');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r5_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r5_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -609,66 +573,54 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const SECTION = 5;
     const SECTION = 5;
-    function yy_r5_1($yy_subpatterns)
+
+    function yy_r5_1()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_DOT;
+        $this->token = Smarty_Internal_Configfileparser::TPC_DOT;
     }
     }
-    function yy_r5_2($yy_subpatterns)
+
+    function yy_r5_2()
     {
 
     {
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;
-    $this->yypopstate();
+        $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;
+        $this->yypopstate();
     }
 
     }
 
-
     public function yylex6()
     {
     public function yylex6()
     {
-        $tokenMap = array (
-              1 => 0,
-              2 => 0,
-            );
-        if ($this->counter >=  strlen($this->data)) {
+        if (!isset($this->yy_global_pattern6)) {
+            $this->yy_global_pattern6 = "/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/iS";
+        }
+        if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                        ' an empty string.  Input "' . substr($this->data,
-                        $this->counter, 5) . '... state TRIPPLE');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state TRIPPLE');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                        $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r6_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r6_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -681,42 +633,40 @@ class Smarty_Internal_Configfilelexer
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 } elseif ($r === false) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
-                    if ($this->counter >=  strlen($this->data)) {
+                    if ($this->counter >= strlen($this->data)) {
                         return false; // end of input
                     }
                     // skip this token
                     continue;
                         return false; // end of input
                     }
                     // skip this token
                     continue;
-                }            } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                    ': ' . $this->data[$this->counter]);
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-
     } // end function
 
     } // end function
 
-
     const TRIPPLE = 6;
     const TRIPPLE = 6;
-    function yy_r6_1($yy_subpatterns)
-    {
 
 
-    $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;
-    $this->yypopstate();
-    $this->yypushstate(self::START);
-    }
-    function yy_r6_2($yy_subpatterns)
+    function yy_r6_1()
     {
 
     {
 
-  $to = strlen($this->data);
-  preg_match("/\"\"\"[ \t\r]*[\n#;]/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
-  if (isset($match[0][1])) {
-    $to = $match[0][1];
-  } else {
-    $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
-  }  
-  $this->value = substr($this->data,$this->counter,$to-$this->counter);
-  $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;
+        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;
+        $this->yypopstate();
+        $this->yypushstate(self::START);
     }
 
     }
 
+    function yy_r6_2()
+    {
 
 
+        $to = strlen($this->data);
+        preg_match("/\"\"\"[ \t\r]*[\n#;]/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        if (isset($match[0][1])) {
+            $to = $match[0][1];
+        } else {
+            $this->compiler->trigger_template_error("missing or misspelled literal closing tag");
+        }
+        $this->value = substr($this->data, $this->counter, $to - $this->counter);
+        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;
+    }
 }
 }
index acb401a80604008cd9a6c189de200b4b4d949277..51e4a9bbff222c77cedd6d4d21378de162dbab8b 100644 (file)
@@ -1,7 +1,10 @@
 <?php
 <?php
+
 class TPC_yyToken implements ArrayAccess
 {
 class TPC_yyToken implements ArrayAccess
 {
+
     public $string = '';
     public $string = '';
+
     public $metadata = array();
 
     public function __construct($s, $m = array())
     public $metadata = array();
 
     public function __construct($s, $m = array())
@@ -38,8 +41,7 @@ class TPC_yyToken implements ArrayAccess
     {
         if ($offset === null) {
             if (isset($value[0])) {
     {
         if ($offset === null) {
             if (isset($value[0])) {
-                $x = ($value instanceof TPC_yyToken) ?
-                    $value->metadata : $value;
+                $x = ($value instanceof TPC_yyToken) ? $value->metadata : $value;
                 $this->metadata = array_merge($this->metadata, $x);
 
                 return;
                 $this->metadata = array_merge($this->metadata, $x);
 
                 return;
@@ -66,28 +68,31 @@ class TPC_yyToken implements ArrayAccess
 
 class TPC_yyStackEntry
 {
 
 class TPC_yyStackEntry
 {
+
     public $stateno;       /* The state-number */
     public $major;         /* The major token value.  This is the code
                      ** number for the token at this stack level */
     public $minor; /* The user-supplied minor token value.  This
                      ** is the value of the token  */
     public $stateno;       /* The state-number */
     public $major;         /* The major token value.  This is the code
                      ** number for the token at this stack level */
     public $minor; /* The user-supplied minor token value.  This
                      ** is the value of the token  */
-};
+}
 
 
+;
 
 #line 12 "../smarty/lexer/smarty_internal_configfileparser.y"
 
 /**
 
 #line 12 "../smarty/lexer/smarty_internal_configfileparser.y"
 
 /**
-* Smarty Internal Plugin Configfileparse
-*
-* This is the config file parser.
-* It is generated from the smarty_internal_configfileparser.y file
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Configfileparse
+ *
+ * This is the config file parser.
+ * It is generated from the smarty_internal_configfileparser.y file
+ *
+ * @package    Smarty
+ * @subpackage Compiler
+ * @author     Uwe Tews
+ */
 class Smarty_Internal_Configfileparser
 {
 class Smarty_Internal_Configfileparser
 {
-#line 25 "../smarty/lexer/smarty_internal_configfileparser.y"
+    #line 25 "../smarty/lexer/smarty_internal_configfileparser.y"
 
     /**
      * result status
 
     /**
      * result status
@@ -95,59 +100,67 @@ class Smarty_Internal_Configfileparser
      * @var bool
      */
     public $successful = true;
      * @var bool
      */
     public $successful = true;
+
     /**
      * return value
      *
      * @var mixed
      */
     public $retvalue = 0;
     /**
      * return value
      *
      * @var mixed
      */
     public $retvalue = 0;
+
     /**
      * @var
      */
     public $yymajor;
     /**
      * @var
      */
     public $yymajor;
+
     /**
      * lexer object
      *
      * @var Smarty_Internal_Configfilelexer
      */
     private $lex;
     /**
      * lexer object
      *
      * @var Smarty_Internal_Configfilelexer
      */
     private $lex;
+
     /**
      * internal error flag
      *
      * @var bool
      */
     private $internalError = false;
     /**
      * internal error flag
      *
      * @var bool
      */
     private $internalError = false;
+
     /**
      * compiler object
      *
      * @var Smarty_Internal_Config_File_Compiler
      */
     public $compiler = null;
     /**
      * compiler object
      *
      * @var Smarty_Internal_Config_File_Compiler
      */
     public $compiler = null;
+
     /**
      * smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
     /**
      * smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
+
     /**
      * copy of config_overwrite property
      *
      * @var bool
      */
     private $configOverwrite = false;
     /**
      * copy of config_overwrite property
      *
      * @var bool
      */
     private $configOverwrite = false;
+
     /**
      * copy of config_read_hidden property
      *
      * @var bool
      */
     private $configReadHidden = false;
     /**
      * copy of config_read_hidden property
      *
      * @var bool
      */
     private $configReadHidden = false;
+
     /**
      * helper map
      *
      * @var array
      */
     /**
      * helper map
      *
      * @var array
      */
-    private static $escapes_single = Array('\\' => '\\',
-                                           '\'' => '\'');
+    private static $escapes_single = Array('\\' => '\\', '\'' => '\'');
 
     /**
      * constructor
 
     /**
      * constructor
@@ -300,106 +313,86 @@ class Smarty_Internal_Configfileparser
         }
     }
 
         }
     }
 
-    const TPC_OPENB                          =  1;
-    const TPC_SECTION                        =  2;
-    const TPC_CLOSEB                         =  3;
-    const TPC_DOT                            =  4;
-    const TPC_ID                             =  5;
-    const TPC_EQUAL                          =  6;
-    const TPC_FLOAT                          =  7;
-    const TPC_INT                            =  8;
-    const TPC_BOOL                           =  9;
-    const TPC_SINGLE_QUOTED_STRING           = 10;
-    const TPC_DOUBLE_QUOTED_STRING           = 11;
-    const TPC_TRIPPLE_QUOTES                 = 12;
-    const TPC_TRIPPLE_TEXT                   = 13;
-    const TPC_TRIPPLE_QUOTES_END             = 14;
-    const TPC_NAKED_STRING                   = 15;
-    const TPC_OTHER                          = 16;
-    const TPC_NEWLINE                        = 17;
-    const TPC_COMMENTSTART                   = 18;
+    const TPC_OPENB = 1;
+
+    const TPC_SECTION = 2;
+
+    const TPC_CLOSEB = 3;
+
+    const TPC_DOT = 4;
+
+    const TPC_ID = 5;
+
+    const TPC_EQUAL = 6;
+
+    const TPC_FLOAT = 7;
+
+    const TPC_INT = 8;
+
+    const TPC_BOOL = 9;
+
+    const TPC_SINGLE_QUOTED_STRING = 10;
+
+    const TPC_DOUBLE_QUOTED_STRING = 11;
+
+    const TPC_TRIPPLE_QUOTES = 12;
+
+    const TPC_TRIPPLE_TEXT = 13;
+
+    const TPC_TRIPPLE_QUOTES_END = 14;
+
+    const TPC_NAKED_STRING = 15;
+
+    const TPC_OTHER = 16;
+
+    const TPC_NEWLINE = 17;
+
+    const TPC_COMMENTSTART = 18;
+
     const YY_NO_ACTION = 60;
     const YY_NO_ACTION = 60;
+
     const YY_ACCEPT_ACTION = 59;
     const YY_ACCEPT_ACTION = 59;
+
     const YY_ERROR_ACTION = 58;
 
     const YY_SZ_ACTTAB = 38;
     const YY_ERROR_ACTION = 58;
 
     const YY_SZ_ACTTAB = 38;
-static public $yy_action = array(
-     29,   30,   34,   33,   24,   13,   19,   25,   35,   21,
-     59,    8,    3,    1,   20,   12,   14,   31,   20,   12,
-     15,   17,   23,   18,   27,   26,    4,    5,    6,   32,
-      2,   11,   28,   22,   16,    9,    7,   10,
-    );
-    static public $yy_lookahead = array(
-      7,    8,    9,   10,   11,   12,    5,   27,   15,   16,
-     20,   21,   23,   23,   17,   18,   13,   14,   17,   18,
-     15,    2,   17,    4,   25,   26,    6,    3,    3,   14,
-     23,    1,   24,   17,    2,   25,   22,   25,
-);
-    const YY_SHIFT_USE_DFLT = -8;
+
+    static public $yy_action = array(29, 30, 34, 33, 24, 13, 19, 25, 35, 21, 59, 8, 3, 1, 20, 12, 14, 31, 20, 12, 15, 17, 23, 18, 27, 26, 4, 5, 6, 32, 2, 11, 28, 22, 16, 9, 7, 10,);
+
+    static public $yy_lookahead = array(7, 8, 9, 10, 11, 12, 5, 27, 15, 16, 20, 21, 23, 23, 17, 18, 13, 14, 17, 18, 15, 2, 17, 4, 25, 26, 6, 3, 3, 14, 23, 1, 24, 17, 2, 25, 22, 25,);
+
+    const YY_SHIFT_USE_DFLT = - 8;
+
     const YY_SHIFT_MAX = 19;
     const YY_SHIFT_MAX = 19;
-    static public $yy_shift_ofst = array(
-     -8,    1,    1,    1,   -7,   -3,   -3,   30,   -8,   -8,
-     -8,   19,    5,    3,   15,   16,   24,   25,   32,   20,
-);
-    const YY_REDUCE_USE_DFLT = -21;
+
+    static public $yy_shift_ofst = array(- 8, 1, 1, 1, - 7, - 3, - 3, 30, - 8, - 8, - 8, 19, 5, 3, 15, 16, 24, 25, 32, 20,);
+
+    const YY_REDUCE_USE_DFLT = - 21;
+
     const YY_REDUCE_MAX = 10;
     const YY_REDUCE_MAX = 10;
-    static public $yy_reduce_ofst = array(
-    -10,   -1,   -1,   -1,  -20,   10,   12,    8,   14,    7,
-    -11,
-);
-    static public $yyExpectedTokens = array(
-         array(),
-         array(5, 17, 18, ),
-         array(5, 17, 18, ),
-         array(5, 17, 18, ),
-         array(7, 8, 9, 10, 11, 12, 15, 16, ),
-         array(17, 18, ),
-         array(17, 18, ),
-         array(1, ),
-         array(),
-         array(),
-         array(),
-         array(2, 4, ),
-         array(15, 17, ),
-         array(13, 14, ),
-         array(14, ),
-         array(17, ),
-         array(3, ),
-         array(3, ),
-         array(2, ),
-         array(6, ),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-         array(),
-);
-    static public $yy_default = array(
-     44,   37,   41,   40,   58,   58,   58,   36,   39,   44,
-     44,   58,   58,   58,   58,   58,   58,   58,   58,   58,
-     55,   54,   57,   56,   50,   45,   43,   42,   38,   46,
-     47,   52,   51,   49,   48,   53,
-);
+
+    static public $yy_reduce_ofst = array(- 10, - 1, - 1, - 1, - 20, 10, 12, 8, 14, 7, - 11,);
+
+    static public $yyExpectedTokens = array(array(), array(5, 17, 18,), array(5, 17, 18,), array(5, 17, 18,), array(7, 8, 9, 10, 11, 12, 15, 16,), array(17, 18,), array(17, 18,), array(1,), array(), array(), array(), array(2, 4,), array(15, 17,), array(13, 14,), array(14,), array(17,), array(3,), array(3,), array(2,), array(6,), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),);
+
+    static public $yy_default = array(44, 37, 41, 40, 58, 58, 58, 36, 39, 44, 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, 55, 54, 57, 56, 50, 45, 43, 42, 38, 46, 47, 52, 51, 49, 48, 53,);
+
     const YYNOCODE = 29;
     const YYNOCODE = 29;
+
     const YYSTACKDEPTH = 100;
     const YYSTACKDEPTH = 100;
+
     const YYNSTATE = 36;
     const YYNSTATE = 36;
+
     const YYNRULE = 22;
     const YYNRULE = 22;
+
     const YYERRORSYMBOL = 19;
     const YYERRORSYMBOL = 19;
+
     const YYERRSYMDT = 'yy0';
     const YYERRSYMDT = 'yy0';
+
     const YYFALLBACK = 0;
     const YYFALLBACK = 0;
-    public static $yyFallback = array(
-    );
+
+    public static $yyFallback = array();
+
     public function Trace($TraceFILE, $zTracePrompt)
     {
         if (!$TraceFILE) {
     public function Trace($TraceFILE, $zTracePrompt)
     {
         if (!$TraceFILE) {
@@ -418,45 +411,16 @@ static public $yy_action = array(
     }
 
     public $yyTraceFILE;
     }
 
     public $yyTraceFILE;
+
     public $yyTracePrompt;
     public $yyTracePrompt;
+
     public $yyidx;                    /* Index of top element in stack */
     public $yyerrcnt;                 /* Shifts left before out of the error */
     public $yystack = array();  /* The parser's stack */
 
     public $yyidx;                    /* Index of top element in stack */
     public $yyerrcnt;                 /* Shifts left before out of the error */
     public $yystack = array();  /* The parser's stack */
 
-    public $yyTokenName = array(
-  '$',             'OPENB',         'SECTION',       'CLOSEB',      
-  'DOT',           'ID',            'EQUAL',         'FLOAT',       
-  'INT',           'BOOL',          'SINGLE_QUOTED_STRING',  'DOUBLE_QUOTED_STRING',
-  'TRIPPLE_QUOTES',  'TRIPPLE_TEXT',  'TRIPPLE_QUOTES_END',  'NAKED_STRING',
-  'OTHER',         'NEWLINE',       'COMMENTSTART',  'error',       
-  'start',         'global_vars',   'sections',      'var_list',    
-  'section',       'newline',       'var',           'value',       
-    );
-
-    public static $yyRuleName = array(
-  "start ::= global_vars sections",
-  "global_vars ::= var_list",
-  "sections ::= sections section",
-  "sections ::=",
-  "section ::= OPENB SECTION CLOSEB newline var_list",
-  "section ::= OPENB DOT SECTION CLOSEB newline var_list",
-  "var_list ::= var_list newline",
-  "var_list ::= var_list var",
-  "var_list ::=",
-  "var ::= ID EQUAL value",
-  "value ::= FLOAT",
-  "value ::= INT",
-  "value ::= BOOL",
-  "value ::= SINGLE_QUOTED_STRING",
-  "value ::= DOUBLE_QUOTED_STRING",
-  "value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END",
-  "value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END",
-  "value ::= NAKED_STRING",
-  "value ::= OTHER",
-  "newline ::= NEWLINE",
-  "newline ::= COMMENTSTART NEWLINE",
-  "newline ::= COMMENTSTART NAKED_STRING NEWLINE",
-    );
+    public $yyTokenName = array('$', 'OPENB', 'SECTION', 'CLOSEB', 'DOT', 'ID', 'EQUAL', 'FLOAT', 'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING', 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', 'start', 'global_vars', 'sections', 'var_list', 'section', 'newline', 'var', 'value',);
+
+    public static $yyRuleName = array('start ::= global_vars sections', 'global_vars ::= var_list', 'sections ::= sections section', 'sections ::=', 'section ::= OPENB SECTION CLOSEB newline var_list', 'section ::= OPENB DOT SECTION CLOSEB newline var_list', 'var_list ::= var_list newline', 'var_list ::= var_list var', 'var_list ::=', 'var ::= ID EQUAL value', 'value ::= FLOAT', 'value ::= INT', 'value ::= BOOL', 'value ::= SINGLE_QUOTED_STRING', 'value ::= DOUBLE_QUOTED_STRING', 'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END', 'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END', 'value ::= NAKED_STRING', 'value ::= OTHER', 'newline ::= NEWLINE', 'newline ::= COMMENTSTART NEWLINE', 'newline ::= COMMENTSTART NAKED_STRING NEWLINE',);
 
     public function tokenName($tokenType)
     {
 
     public function tokenName($tokenType)
     {
@@ -473,24 +437,23 @@ static public $yy_action = array(
     public static function yy_destructor($yymajor, $yypminor)
     {
         switch ($yymajor) {
     public static function yy_destructor($yymajor, $yypminor)
     {
         switch ($yymajor) {
-            default:  break;   /* If no destructor action specified: do nothing */
+            default:
+                break;   /* If no destructor action specified: do nothing */
         }
     }
 
     public function yy_pop_parser_stack()
     {
         }
     }
 
     public function yy_pop_parser_stack()
     {
-        if (!count($this->yystack)) {
+        if (empty($this->yystack)) {
             return;
         }
         $yytos = array_pop($this->yystack);
         if ($this->yyTraceFILE && $this->yyidx >= 0) {
             return;
         }
         $yytos = array_pop($this->yystack);
         if ($this->yyTraceFILE && $this->yyidx >= 0) {
-            fwrite($this->yyTraceFILE,
-                $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
-                    "\n");
+            fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . "\n");
         }
         $yymajor = $yytos->major;
         self::yy_destructor($yymajor, $yytos->minor);
         }
         $yymajor = $yytos->major;
         self::yy_destructor($yymajor, $yytos->minor);
-        $this->yyidx--;
+        $this->yyidx --;
 
         return $yymajor;
     }
 
         return $yymajor;
     }
@@ -507,10 +470,18 @@ static public $yy_action = array(
 
     public function yy_get_expected_tokens($token)
     {
 
     public function yy_get_expected_tokens($token)
     {
+        static $res3 = array();
+        static $res4 = array();
         $state = $this->yystack[$this->yyidx]->stateno;
         $expected = self::$yyExpectedTokens[$state];
         $state = $this->yystack[$this->yyidx]->stateno;
         $expected = self::$yyExpectedTokens[$state];
-        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
-            return $expected;
+        if (isset($res3[$state][$token])) {
+            if ($res3[$state][$token]) {
+                return $expected;
+            }
+        } else {
+            if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) {
+                return $expected;
+            }
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
@@ -520,7 +491,7 @@ static public $yy_action = array(
                 // reduce action
                 $done = 0;
                 do {
                 // reduce action
                 $done = 0;
                 do {
-                    if ($done++ == 100) {
+                    if ($done ++ == 100) {
                         $this->yyidx = $yyidx;
                         $this->yystack = $stack;
                         // too much recursion prevents proper detection
                         $this->yyidx = $yyidx;
                         $this->yystack = $stack;
                         // too much recursion prevents proper detection
@@ -529,22 +500,26 @@ static public $yy_action = array(
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
-                    $nextstate = $this->yy_find_reduce_action(
-                        $this->yystack[$this->yyidx]->stateno,
-                        self::$yyRuleInfo[$yyruleno][0]);
+                    $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]);
                     if (isset(self::$yyExpectedTokens[$nextstate])) {
                     if (isset(self::$yyExpectedTokens[$nextstate])) {
-                $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
-                            if (in_array($token,
-                                  self::$yyExpectedTokens[$nextstate], true)) {
-                            $this->yyidx = $yyidx;
-                            $this->yystack = $stack;
-
-                            return array_unique($expected);
+                        $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
+                        if (isset($res4[$nextstate][$token])) {
+                            if ($res4[$nextstate][$token]) {
+                                $this->yyidx = $yyidx;
+                                $this->yystack = $stack;
+                                return array_unique($expected);
+                            }
+                        } else {
+                            if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
+                                $this->yyidx = $yyidx;
+                                $this->yystack = $stack;
+                                return array_unique($expected);
+                            }
                         }
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
                         }
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
-                        $this->yyidx++;
+                        $this->yyidx ++;
                         $x = new TPC_yyStackEntry;
                         $x->stateno = $nextstate;
                         $x->major = self::$yyRuleInfo[$yyruleno][0];
                         $x = new TPC_yyStackEntry;
                         $x->stateno = $nextstate;
                         $x->major = self::$yyRuleInfo[$yyruleno][0];
@@ -569,20 +544,28 @@ static public $yy_action = array(
             }
             break;
         } while (true);
             }
             break;
         } while (true);
-    $this->yyidx = $yyidx;
-    $this->yystack = $stack;
+        $this->yyidx = $yyidx;
+        $this->yystack = $stack;
 
         return array_unique($expected);
     }
 
     public function yy_is_expected_token($token)
     {
 
         return array_unique($expected);
     }
 
     public function yy_is_expected_token($token)
     {
+        static $res = array();
+        static $res2 = array();
         if ($token === 0) {
             return true; // 0 is not part of this
         }
         $state = $this->yystack[$this->yyidx]->stateno;
         if ($token === 0) {
             return true; // 0 is not part of this
         }
         $state = $this->yystack[$this->yyidx]->stateno;
-        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
-            return true;
+        if (isset($res[$state][$token])) {
+            if ($res[$state][$token]) {
+                return true;
+            }
+        } else {
+            if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) {
+                return true;
+            }
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
@@ -592,7 +575,7 @@ static public $yy_action = array(
                 // reduce action
                 $done = 0;
                 do {
                 // reduce action
                 $done = 0;
                 do {
-                    if ($done++ == 100) {
+                    if ($done ++ == 100) {
                         $this->yyidx = $yyidx;
                         $this->yystack = $stack;
                         // too much recursion prevents proper detection
                         $this->yyidx = $yyidx;
                         $this->yystack = $stack;
                         // too much recursion prevents proper detection
@@ -601,19 +584,23 @@ static public $yy_action = array(
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
-                    $nextstate = $this->yy_find_reduce_action(
-                        $this->yystack[$this->yyidx]->stateno,
-                        self::$yyRuleInfo[$yyruleno][0]);
-                    if (isset(self::$yyExpectedTokens[$nextstate]) &&
-                          in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
-                        $this->yyidx = $yyidx;
-                        $this->yystack = $stack;
-
-                        return true;
+                    $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]);
+                    if (isset($res2[$nextstate][$token])) {
+                        if ($res2[$nextstate][$token]) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return true;
+                        }
+                    } else {
+                        if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return true;
+                        }
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
-                        $this->yyidx++;
+                        $this->yyidx ++;
                         $x = new TPC_yyStackEntry;
                         $x->stateno = $nextstate;
                         $x->major = self::$yyRuleInfo[$yyruleno][0];
                         $x = new TPC_yyStackEntry;
                         $x->stateno = $nextstate;
                         $x->major = self::$yyRuleInfo[$yyruleno][0];
@@ -648,7 +635,7 @@ static public $yy_action = array(
         return true;
     }
 
         return true;
     }
 
-   public function yy_find_shift_action($iLookAhead)
+    public function yy_find_shift_action($iLookAhead)
     {
         $stateno = $this->yystack[$this->yyidx]->stateno;
 
     {
         $stateno = $this->yystack[$this->yyidx]->stateno;
 
@@ -665,14 +652,10 @@ static public $yy_action = array(
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
-        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
-              self::$yy_lookahead[$i] != $iLookAhead) {
-            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
-                   && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) {
+            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
                 if ($this->yyTraceFILE) {
                 if ($this->yyTraceFILE) {
-                    fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " .
-                        $this->yyTokenName[$iLookAhead] . " => " .
-                        $this->yyTokenName[$iFallback] . "\n");
+                    fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[$iLookAhead] . " => " . $this->yyTokenName[$iFallback] . "\n");
                 }
 
                 return $this->yy_find_shift_action($iFallback);
                 }
 
                 return $this->yy_find_shift_action($iFallback);
@@ -699,8 +682,7 @@ static public $yy_action = array(
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
-        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
-              self::$yy_lookahead[$i] != $iLookAhead) {
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) {
             return self::$yy_default[$stateno];
         } else {
             return self::$yy_action[$i];
             return self::$yy_default[$stateno];
         } else {
             return self::$yy_action[$i];
@@ -709,19 +691,19 @@ static public $yy_action = array(
 
     public function yy_shift($yyNewState, $yyMajor, $yypMinor)
     {
 
     public function yy_shift($yyNewState, $yyMajor, $yypMinor)
     {
-        $this->yyidx++;
+        $this->yyidx ++;
         if ($this->yyidx >= self::YYSTACKDEPTH) {
         if ($this->yyidx >= self::YYSTACKDEPTH) {
-            $this->yyidx--;
+            $this->yyidx --;
             if ($this->yyTraceFILE) {
                 fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt);
             }
             while ($this->yyidx >= 0) {
                 $this->yy_pop_parser_stack();
             }
             if ($this->yyTraceFILE) {
                 fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt);
             }
             while ($this->yyidx >= 0) {
                 $this->yy_pop_parser_stack();
             }
-#line 255 "../smarty/lexer/smarty_internal_configfileparser.y"
+            #line 255 "../smarty/lexer/smarty_internal_configfileparser.y"
 
 
-    $this->internalError = true;
-    $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
+            $this->internalError = true;
+            $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
 
             return;
         }
 
             return;
         }
@@ -729,152 +711,132 @@ static public $yy_action = array(
         $yytos->stateno = $yyNewState;
         $yytos->major = $yyMajor;
         $yytos->minor = $yypMinor;
         $yytos->stateno = $yyNewState;
         $yytos->major = $yyMajor;
         $yytos->minor = $yypMinor;
-        array_push($this->yystack, $yytos);
+        $this->yystack[] = $yytos;
         if ($this->yyTraceFILE && $this->yyidx > 0) {
         if ($this->yyTraceFILE && $this->yyidx > 0) {
-            fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt,
-                $yyNewState);
+            fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState);
             fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt);
             fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt);
-            for ($i = 1; $i <= $this->yyidx; $i++) {
-                fprintf($this->yyTraceFILE, " %s",
-                    $this->yyTokenName[$this->yystack[$i]->major]);
+            for ($i = 1; $i <= $this->yyidx; $i ++) {
+                fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[$this->yystack[$i]->major]);
             }
             }
-            fwrite($this->yyTraceFILE,"\n");
+            fwrite($this->yyTraceFILE, "\n");
         }
     }
 
         }
     }
 
-    public static $yyRuleInfo = array(
-  array( 0 => 20, 1 => 2 ),
-  array( 0 => 21, 1 => 1 ),
-  array( 0 => 22, 1 => 2 ),
-  array( 0 => 22, 1 => 0 ),
-  array( 0 => 24, 1 => 5 ),
-  array( 0 => 24, 1 => 6 ),
-  array( 0 => 23, 1 => 2 ),
-  array( 0 => 23, 1 => 2 ),
-  array( 0 => 23, 1 => 0 ),
-  array( 0 => 26, 1 => 3 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 3 ),
-  array( 0 => 27, 1 => 2 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 27, 1 => 1 ),
-  array( 0 => 25, 1 => 1 ),
-  array( 0 => 25, 1 => 2 ),
-  array( 0 => 25, 1 => 3 ),
-    );
-
-    public static $yyReduceMap = array(
-        0 => 0,
-        2 => 0,
-        3 => 0,
-        19 => 0,
-        20 => 0,
-        21 => 0,
-        1 => 1,
-        4 => 4,
-        5 => 5,
-        6 => 6,
-        7 => 7,
-        8 => 8,
-        9 => 9,
-        10 => 10,
-        11 => 11,
-        12 => 12,
-        13 => 13,
-        14 => 14,
-        15 => 15,
-        16 => 16,
-        17 => 17,
-        18 => 17,
-    );
-#line 261 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r0(){
-    $this->_retvalue = null;
-    }
-#line 266 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r1(){
-    $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor);
-    $this->_retvalue = null;
+    public static $yyRuleInfo = array(array(0 => 20, 1 => 2), array(0 => 21, 1 => 1), array(0 => 22, 1 => 2), array(0 => 22, 1 => 0), array(0 => 24, 1 => 5), array(0 => 24, 1 => 6), array(0 => 23, 1 => 2), array(0 => 23, 1 => 2), array(0 => 23, 1 => 0), array(0 => 26, 1 => 3), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 27, 1 => 3), array(0 => 27, 1 => 2), array(0 => 27, 1 => 1), array(0 => 27, 1 => 1), array(0 => 25, 1 => 1), array(0 => 25, 1 => 2), array(0 => 25, 1 => 3),);
+
+    public static $yyReduceMap = array(0 => 0, 2 => 0, 3 => 0, 19 => 0, 20 => 0, 21 => 0, 1 => 1, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 16 => 16, 17 => 17, 18 => 17,);
+
+    #line 261 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r0()
+    {
+        $this->_retvalue = null;
     }
     }
-#line 280 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r4(){
-    $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
-    $this->_retvalue = null;
+
+    #line 266 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r1()
+    {
+        $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor);
+        $this->_retvalue = null;
     }
     }
-#line 285 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r5(){
-    if ($this->configReadHidden) {
-        $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);
+
+    #line 280 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r4()
+    {
+        $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor);
+        $this->_retvalue = null;
     }
     }
-    $this->_retvalue = null;
+
+    #line 285 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r5()
+    {
+        if ($this->configReadHidden) {
+            $this->add_section_vars($this->yystack[$this->yyidx + - 3]->minor, $this->yystack[$this->yyidx + 0]->minor);
+        }
+        $this->_retvalue = null;
     }
     }
-#line 293 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r6(){
-    $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;
+
+    #line 293 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r6()
+    {
+        $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
     }
     }
-#line 297 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r7(){
-    $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));
+
+    #line 297 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r7()
+    {
+        $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, Array($this->yystack[$this->yyidx + 0]->minor));
     }
     }
-#line 301 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r8(){
-    $this->_retvalue = Array();
+
+    #line 301 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r8()
+    {
+        $this->_retvalue = Array();
     }
     }
-#line 307 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r9(){
-    $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + -2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor);
+
+    #line 307 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r9()
+    {
+        $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + - 2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor);
     }
     }
-#line 312 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r10(){
-    $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;
+
+    #line 312 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r10()
+    {
+        $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor;
     }
     }
-#line 316 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r11(){
-    $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;
+
+    #line 316 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r11()
+    {
+        $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor;
     }
     }
-#line 320 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r12(){
-    $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);
+
+    #line 320 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r12()
+    {
+        $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor);
     }
     }
-#line 324 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r13(){
-    $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);
+
+    #line 324 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r13()
+    {
+        $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor);
     }
     }
-#line 328 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r14(){
-    $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);
+
+    #line 328 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r14()
+    {
+        $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor);
     }
     }
-#line 332 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r15(){
-    $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + -1]->minor);
+
+    #line 332 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r15()
+    {
+        $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + - 1]->minor);
     }
     }
-#line 336 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r16(){
-    $this->_retvalue = '';
+
+    #line 336 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r16()
+    {
+        $this->_retvalue = '';
     }
     }
-#line 340 "../smarty/lexer/smarty_internal_configfileparser.y"
-    function yy_r17(){
-    $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
+
+    #line 340 "../smarty/lexer/smarty_internal_configfileparser.y"
+    function yy_r17()
+    {
+        $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
     }
 
     private $_retvalue;
 
     public function yy_reduce($yyruleno)
     {
     }
 
     private $_retvalue;
 
     public function yy_reduce($yyruleno)
     {
-        $yymsp = $this->yystack[$this->yyidx];
-        if ($this->yyTraceFILE && $yyruleno >= 0
-              && $yyruleno < count(self::$yyRuleName)) {
-            fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n",
-                $this->yyTracePrompt, $yyruleno,
-                self::$yyRuleName[$yyruleno]);
+        if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) {
+            fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, self::$yyRuleName[$yyruleno]);
         }
 
         $this->_retvalue = $yy_lefthand_side = null;
         }
 
         $this->_retvalue = $yy_lefthand_side = null;
-        if (array_key_exists($yyruleno, self::$yyReduceMap)) {
+        if (isset(self::$yyReduceMap[$yyruleno])) {
             // call the action
             $this->_retvalue = null;
             $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
             // call the action
             $this->_retvalue = null;
             $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
@@ -883,14 +845,14 @@ static public $yy_action = array(
         $yygoto = self::$yyRuleInfo[$yyruleno][0];
         $yysize = self::$yyRuleInfo[$yyruleno][1];
         $this->yyidx -= $yysize;
         $yygoto = self::$yyRuleInfo[$yyruleno][0];
         $yysize = self::$yyRuleInfo[$yyruleno][1];
         $this->yyidx -= $yysize;
-        for ($i = $yysize; $i; $i--) {
+        for ($i = $yysize; $i; $i --) {
             // pop all of the right-hand side parameters
             array_pop($this->yystack);
         }
         $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
         if ($yyact < self::YYNSTATE) {
             if (!$this->yyTraceFILE && $yysize) {
             // pop all of the right-hand side parameters
             array_pop($this->yystack);
         }
         $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
         if ($yyact < self::YYNSTATE) {
             if (!$this->yyTraceFILE && $yysize) {
-                $this->yyidx++;
+                $this->yyidx ++;
                 $x = new TPC_yyStackEntry;
                 $x->stateno = $yyact;
                 $x->major = $yygoto;
                 $x = new TPC_yyStackEntry;
                 $x->stateno = $yyact;
                 $x->major = $yygoto;
@@ -908,32 +870,34 @@ static public $yy_action = array(
     {
         if ($this->yyTraceFILE) {
             fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt);
     {
         if ($this->yyTraceFILE) {
             fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt);
-        } while ($this->yyidx >= 0) {
+        }
+        while ($this->yyidx >= 0) {
             $this->yy_pop_parser_stack();
         }
     }
 
     public function yy_syntax_error($yymajor, $TOKEN)
     {
             $this->yy_pop_parser_stack();
         }
     }
 
     public function yy_syntax_error($yymajor, $TOKEN)
     {
-#line 248 "../smarty/lexer/smarty_internal_configfileparser.y"
+        #line 248 "../smarty/lexer/smarty_internal_configfileparser.y"
 
 
-    $this->internalError = true;
-    $this->yymajor = $yymajor;
-    $this->compiler->trigger_config_file_error();
+        $this->internalError = true;
+        $this->yymajor = $yymajor;
+        $this->compiler->trigger_config_file_error();
     }
 
     public function yy_accept()
     {
         if ($this->yyTraceFILE) {
             fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt);
     }
 
     public function yy_accept()
     {
         if ($this->yyTraceFILE) {
             fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt);
-        } while ($this->yyidx >= 0) {
+        }
+        while ($this->yyidx >= 0) {
             $this->yy_pop_parser_stack();
         }
             $this->yy_pop_parser_stack();
         }
-#line 241 "../smarty/lexer/smarty_internal_configfileparser.y"
+        #line 241 "../smarty/lexer/smarty_internal_configfileparser.y"
 
 
-    $this->successful = !$this->internalError;
-    $this->internalError = false;
-    $this->retvalue = $this->_retvalue;
+        $this->successful = !$this->internalError;
+        $this->internalError = false;
+        $this->retvalue = $this->_retvalue;
     }
 
     public function doParse($yymajor, $yytokenvalue)
     }
 
     public function doParse($yymajor, $yytokenvalue)
@@ -942,30 +906,28 @@ static public $yy_action = array(
 
         if ($this->yyidx === null || $this->yyidx < 0) {
             $this->yyidx = 0;
 
         if ($this->yyidx === null || $this->yyidx < 0) {
             $this->yyidx = 0;
-            $this->yyerrcnt = -1;
+            $this->yyerrcnt = - 1;
             $x = new TPC_yyStackEntry;
             $x->stateno = 0;
             $x->major = 0;
             $this->yystack = array();
             $x = new TPC_yyStackEntry;
             $x->stateno = 0;
             $x->major = 0;
             $this->yystack = array();
-            array_push($this->yystack, $x);
+            $this->yystack[] = $x;
         }
         }
-        $yyendofinput = ($yymajor==0);
+        $yyendofinput = ($yymajor == 0);
 
         if ($this->yyTraceFILE) {
 
         if ($this->yyTraceFILE) {
-            fprintf($this->yyTraceFILE, "%sInput %s\n",
-                $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
+            fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
         }
 
         do {
             $yyact = $this->yy_find_shift_action($yymajor);
         }
 
         do {
             $yyact = $this->yy_find_shift_action($yymajor);
-            if ($yymajor < self::YYERRORSYMBOL &&
-                  !$this->yy_is_expected_token($yymajor)) {
+            if ($yymajor < self::YYERRORSYMBOL && !$this->yy_is_expected_token($yymajor)) {
                 // force a syntax error
                 $yyact = self::YY_ERROR_ACTION;
             }
             if ($yyact < self::YYNSTATE) {
                 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
                 // force a syntax error
                 $yyact = self::YY_ERROR_ACTION;
             }
             if ($yyact < self::YYNSTATE) {
                 $this->yy_shift($yyact, $yymajor, $yytokenvalue);
-                $this->yyerrcnt--;
+                $this->yyerrcnt --;
                 if ($yyendofinput && $this->yyidx >= 0) {
                     $yymajor = 0;
                 } else {
                 if ($yyendofinput && $this->yyidx >= 0) {
                     $yymajor = 0;
                 } else {
@@ -975,8 +937,7 @@ static public $yy_action = array(
                 $this->yy_reduce($yyact - self::YYNSTATE);
             } elseif ($yyact == self::YY_ERROR_ACTION) {
                 if ($this->yyTraceFILE) {
                 $this->yy_reduce($yyact - self::YYNSTATE);
             } elseif ($yyact == self::YY_ERROR_ACTION) {
                 if ($this->yyTraceFILE) {
-                    fprintf($this->yyTraceFILE, "%sSyntax Error!\n",
-                        $this->yyTracePrompt);
+                    fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt);
                 }
                 if (self::YYERRORSYMBOL) {
                     if ($this->yyerrcnt < 0) {
                 }
                 if (self::YYERRORSYMBOL) {
                     if ($this->yyerrcnt < 0) {
@@ -985,19 +946,15 @@ static public $yy_action = array(
                     $yymx = $this->yystack[$this->yyidx]->major;
                     if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) {
                         if ($this->yyTraceFILE) {
                     $yymx = $this->yystack[$this->yyidx]->major;
                     if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) {
                         if ($this->yyTraceFILE) {
-                            fprintf($this->yyTraceFILE, "%sDiscard input token %s\n",
-                                $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
+                            fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
                         }
                         $this->yy_destructor($yymajor, $yytokenvalue);
                         $yymajor = self::YYNOCODE;
                     } else {
                         }
                         $this->yy_destructor($yymajor, $yytokenvalue);
                         $yymajor = self::YYNOCODE;
                     } else {
-                        while ($this->yyidx >= 0 &&
-                                 $yymx != self::YYERRORSYMBOL &&
-        ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
-                              ){
+                        while ($this->yyidx >= 0 && $yymx != self::YYERRORSYMBOL && ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE) {
                             $this->yy_pop_parser_stack();
                         }
                             $this->yy_pop_parser_stack();
                         }
-                        if ($this->yyidx < 0 || $yymajor==0) {
+                        if ($this->yyidx < 0 || $yymajor == 0) {
                             $this->yy_destructor($yymajor, $yytokenvalue);
                             $this->yy_parse_failed();
                             $yymajor = self::YYNOCODE;
                             $this->yy_destructor($yymajor, $yytokenvalue);
                             $this->yy_parse_failed();
                             $yymajor = self::YYNOCODE;
index f12647ace641696c96306846173b80e56902e2fe..89eb9f3abccce57c33a1ff28c71f202425222f9f 100644 (file)
@@ -157,7 +157,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
     /**
      * End logging of cache time
      *
     /**
      * End logging of cache time
      *
-     * @param o\Smarty_Internal_Template $template cached template
+     * @param \Smarty_Internal_Template $template cached template
      */
     public static function end_cache(Smarty_Internal_Template $template)
     {
      */
     public static function end_cache(Smarty_Internal_Template $template)
     {
@@ -196,32 +196,45 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
             $savedIndex = self::$index;
             self::$index = 9999;
         }
             $savedIndex = self::$index;
             self::$index = 9999;
         }
-        // prepare information of assigned variables
-        $ptr = self::get_debug_vars($obj);
         if ($obj instanceof Smarty) {
         if ($obj instanceof Smarty) {
-            $smarty = clone $obj;
+            $smarty = $obj;
         } else {
         } else {
-            $smarty = clone $obj->smarty;
+            $smarty = $obj->smarty;
         }
         }
-        $debugging = $smarty->debugging;
+        // create fresh instance of smarty for displaying the debug console
+        // to avoid problems if the application did overload the Smarty class
+        $debObj = new Smarty();
+        // copy the working dirs from application
+        $debObj->setCompileDir($smarty->getCompileDir());
+        // init properties by hand as user may have edited the original Smarty class
+        $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir());
+        $debObj->force_compile = false;
+        $debObj->compile_check = true;
+        $debObj->left_delimiter = '{';
+        $debObj->right_delimiter = '}';
+        $debObj->security_policy = null;
+        $debObj->debugging = false;
+        $debObj->debugging_ctrl = 'NONE';
+        $debObj->error_reporting = E_ALL & ~E_NOTICE;
+        $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl';
+        $debObj->registered_plugins = array();
+        $debObj->registered_resources = array();
+        $debObj->registered_filters = array();
+        $debObj->autoload_filters = array();
+        $debObj->default_modifiers = array();
+        $debObj->escape_html = true;
+        $debObj->caching = false;
+        $debObj->compile_id = null;
+        $debObj->cache_id = null;
+        // prepare information of assigned variables
+        $ptr = self::get_debug_vars($obj);
         $_assigned_vars = $ptr->tpl_vars;
         ksort($_assigned_vars);
         $_config_vars = $ptr->config_vars;
         ksort($_config_vars);
         $_assigned_vars = $ptr->tpl_vars;
         ksort($_assigned_vars);
         $_config_vars = $ptr->config_vars;
         ksort($_config_vars);
-        $smarty->registered_filters = array();
-        $smarty->autoload_filters = array();
-        $smarty->default_modifiers = array();
-        $smarty->force_compile = false;
-        $smarty->left_delimiter = '{';
-        $smarty->right_delimiter = '}';
-        $smarty->debugging = false;
-        $smarty->debugging_ctrl = 'NONE';
-        $smarty->force_compile = false;
-        $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
-        $_template->caching = false;
-        $_template->smarty->disableSecurity();
-        $_template->cache_id = null;
-        $_template->compile_id = null;
+        $debugging = $smarty->debugging;
+
+        $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj);
         if ($obj instanceof Smarty_Internal_Template) {
             $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
         }
         if ($obj instanceof Smarty_Internal_Template) {
             $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
         }
index 129d129505d7dddb5693968d0be31105cc970d3d..0474378cebedbb51bbdd09bc7e79faad690db2d0 100644 (file)
@@ -11,7 +11,6 @@
 /**
  * Class Smarty_Internal_Extension_CodeFrame
  * Create code frame for compiled and cached templates
 /**
  * Class Smarty_Internal_Extension_CodeFrame
  * Create code frame for compiled and cached templates
-
  */
 class Smarty_Internal_Extension_CodeFrame
 {
  */
 class Smarty_Internal_Extension_CodeFrame
 {
@@ -78,11 +77,19 @@ class Smarty_Internal_Extension_CodeFrame
                 $output .= "?>/*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%*/';\n";
             }
         }
                 $output .= "?>/*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%*/';\n";
             }
         }
-        $output .= "?>\n" . $content;
-        $output .= "<?php }\n}\n?>";
-        return $output;
+        $output .= "?>\n";
+        $output = self::appendCode($output, $content);
+        return self::appendCode($output, "<?php }\n}\n?>");
     }
 
     }
 
+    /**
+     * Create code frame of compiled template function
+     *
+     * @param \Smarty_Internal_Template $_template
+     * @param string                    $content
+     *
+     * @return string
+     */
     public static function createFunctionFrame(Smarty_Internal_Template $_template, $content = '')
     {
         if (!isset($_template->properties['unifunc'])) {
     public static function createFunctionFrame(Smarty_Internal_Template $_template, $content = '')
     {
         if (!isset($_template->properties['unifunc'])) {
@@ -98,4 +105,23 @@ class Smarty_Internal_Extension_CodeFrame
         $output .= "}\n}\n?>";
         return $output;
     }
         $output .= "}\n}\n?>";
         return $output;
     }
+
+    /**
+     * Append code segments and remove unneeded ?> <?php transitions
+     *
+     * @param string $left
+     * @param string $right
+     *
+     * @return string
+     */
+    public static function appendCode($left, $right)
+    {
+        if (preg_match('/\s*\?>$/', $left) && preg_match('/^<\?php\s+/', $right)) {
+            $left = preg_replace('/\s*\?>$/', "\n", $left);
+            $left .= preg_replace('/^<\?php\s+/', '', $right);
+        } else {
+            $left .= $right;
+        }
+        return $left;
+    }
 }
\ No newline at end of file
 }
\ No newline at end of file
index 8cef300d25fa987cd8529d8a2640ac53354eaa61..a30bb22da8281f8adca464a8833ca2534a8630a5 100644 (file)
@@ -133,7 +133,7 @@ class Smarty_Internal_Extension_Config
             // not found, try at parent
             $_ptr = $_ptr->parent;
         }
             // not found, try at parent
             $_ptr = $_ptr->parent;
         }
-        if ($smarty->error_unassigned && $error_enable) {
+        if ($obj->error_unassigned && $error_enable) {
             // force a notice
             $x = $$variable;
         }
             // force a notice
             $x = $$variable;
         }
index 1e306c8c9e2a068b2959281b2b34b9d5d2369bee..c96731ed9a7d59d2a8ae458e04e003659c7e53aa 100644 (file)
  */
 abstract class Smarty_Internal_ParseTree
 {
  */
 abstract class Smarty_Internal_ParseTree
 {
+
     /**
      * Parser object
      *
      * @var object
      */
     public $parser;
     /**
      * Parser object
      *
      * @var object
      */
     public $parser;
+
     /**
      * Buffer content
      *
     /**
      * Buffer content
      *
index c4a7daecd798c5b9ae27cbeea560092cb5633600..a44ae499c825af23b6c4f6f34a591d2367264ab8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
 <?php
 /**
- * Smarty Internal Plugin Templateparser Parsetrees
- * These are classes to build parsetrees in the template parser
+ * Smarty Internal Plugin Templateparser Parse Tree
+ * These are classes to build parse trees in the template parser
  *
  * @package    Smarty
  * @subpackage Compiler
  *
  * @package    Smarty
  * @subpackage Compiler
index 4de3276123d85eb0ce8eccdf6ec2a5319da78b00..bdfa4c48f58d3b58aff1688dae1ab045a48f182a 100644 (file)
@@ -7,6 +7,7 @@
  * @subpackage Compiler
  * @ignore
  */
  * @subpackage Compiler
  * @ignore
  */
+
 /**
  * Double quoted string inside a tag.
  *
 /**
  * Double quoted string inside a tag.
  *
@@ -19,8 +20,8 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree
     /**
      * Create parse tree buffer for double quoted string subtrees
      *
     /**
      * Create parse tree buffer for double quoted string subtrees
      *
-     * @param object            $parser  parser object
-     * @param Smarty_Internal_ParseTree $subtree parsetree buffer
+     * @param object                    $parser  parser object
+     * @param Smarty_Internal_ParseTree $subtree parse tree buffer
      */
     public function __construct($parser, Smarty_Internal_ParseTree $subtree)
     {
      */
     public function __construct($parser, Smarty_Internal_ParseTree $subtree)
     {
@@ -34,18 +35,18 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree
     /**
      * Append buffer to subtree
      *
     /**
      * Append buffer to subtree
      *
-     * @param Smarty_Internal_ParseTree $subtree parsetree buffer
+     * @param Smarty_Internal_ParseTree $subtree parse tree buffer
      */
     public function append_subtree(Smarty_Internal_ParseTree $subtree)
     {
         $last_subtree = count($this->subtrees) - 1;
         if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof Smarty_Internal_ParseTree_Tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
             if ($subtree instanceof Smarty_Internal_ParseTree_Code) {
      */
     public function append_subtree(Smarty_Internal_ParseTree $subtree)
     {
         $last_subtree = count($this->subtrees) - 1;
         if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof Smarty_Internal_ParseTree_Tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
             if ($subtree instanceof Smarty_Internal_ParseTree_Code) {
-                $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
+                $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, '<?php echo ' . $subtree->data . ';?>');
             } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) {
             } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) {
-                $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
+                $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, '<?php echo "' . $subtree->data . '";?>');
             } else {
             } else {
-                $this->subtrees[$last_subtree]->data .= $subtree->data;
+                $this->subtrees[$last_subtree]->data = $this->parser->compiler->appendCode($this->subtrees[$last_subtree]->data, $subtree->data);
             }
         } else {
             $this->subtrees[] = $subtree;
             }
         } else {
             $this->subtrees[] = $subtree;
index 53ba1bcc08a01ca7a35d4e2b3d9ca3d9e9fba202..3197772d1d72632e7f4447d9c34470b82cd55385 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
 <?php
 /**
- * Smarty Internal Plugin Templateparser Parsetrees
- * These are classes to build parsetrees in the template parser
+ * Smarty Internal Plugin Templateparser Parse Tree
+ * These are classes to build parse tree  in the template parser
  *
  * @package    Smarty
  * @subpackage Compiler
  *
  * @package    Smarty
  * @subpackage Compiler
@@ -9,7 +9,6 @@
  * @author     Uwe Tews
  */
 
  * @author     Uwe Tews
  */
 
-
 /**
  * Raw chars as part of a double quoted string.
  *
 /**
  * Raw chars as part of a double quoted string.
  *
index 28bbb938a9b46b0fc885ce79c45ba6b23ad3541c..81475b5f0a7317e5c94a4a977b3eeeeecdef344f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
 <?php
 /**
- * Smarty Internal Plugin Templateparser Parsetrees
- * These are classes to build parsetrees in the template parser
+ * Smarty Internal Plugin Templateparser Parse Tree
+ * These are classes to build parse tree in the template parser
  *
  * @package    Smarty
  * @subpackage Compiler
  *
  * @package    Smarty
  * @subpackage Compiler
@@ -18,6 +18,7 @@
  */
 class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree
 {
  */
 class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree
 {
+
     /**
      * Saved block nesting level
      *
     /**
      * Saved block nesting level
      *
@@ -56,7 +57,9 @@ class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree
     public function assign_to_var()
     {
         $var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser::$prefix_number);
     public function assign_to_var()
     {
         $var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser::$prefix_number);
-        $this->parser->compiler->prefix_code[] = sprintf("<?php ob_start();?>%s<?php %s=ob_get_clean();?>", $this->data, $var);
+        $tmp = $this->parser->compiler->appendCode('<?php ob_start();?>', $this->data);
+        $tmp = $this->parser->compiler->appendCode($tmp, "<?php {$var}=ob_get_clean();?>");
+        $this->parser->compiler->prefix_code[] = sprintf("%s", $tmp);
 
         return $var;
     }
 
         return $var;
     }
index 2bb76c197dc70086a6319383dffd6e2dd37dba5d..7d814edaa68d4bf89ece0d30563daa9c073effe7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
 <?php
 /**
- * Smarty Internal Plugin Templateparser Parsetrees
- * These are classes to build parsetrees in the template parser
+ * Smarty Internal Plugin Templateparser Parse Tree
+ * These are classes to build parse tree in the template parser
  *
  * @package    Smarty
  * @subpackage Compiler
  *
  * @package    Smarty
  * @subpackage Compiler
@@ -18,6 +18,7 @@
  */
 class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
 {
  */
 class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
 {
+
     /**
      * Array of template elements
      *
     /**
      * Array of template elements
      *
@@ -44,8 +45,10 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
     {
         if (!empty($subtree->subtrees)) {
             $this->subtrees = array_merge($this->subtrees, $subtree->subtrees);
     {
         if (!empty($subtree->subtrees)) {
             $this->subtrees = array_merge($this->subtrees, $subtree->subtrees);
-        } else if ($subtree->data !== '') {
-            $this->subtrees[] = $subtree;
+        } else {
+            if ($subtree->data !== '') {
+                $this->subtrees[] = $subtree;
+            }
         }
     }
 
         }
     }
 
@@ -70,7 +73,7 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
                 if ($subtree == '') {
                     continue;
                 }
                 if ($subtree == '') {
                     continue;
                 }
-                $code .= preg_replace('/(<%|%>|<\?php|<\?|\?>|<\/?script)/', "<?php echo '\$1'; ?>\n", $subtree);
+                $code .= preg_replace('/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', "<?php echo '\$1'; ?>\n", $subtree);
                 continue;
             }
             if ($this->subtrees[$key] instanceof Smarty_Internal_ParseTree_Tag) {
                 continue;
             }
             if ($this->subtrees[$key] instanceof Smarty_Internal_ParseTree_Tag) {
@@ -80,13 +83,7 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
                     if ($this->subtrees[$key]->data == '') {
                         continue;
                     }
                     if ($this->subtrees[$key]->data == '') {
                         continue;
                     }
-                    $newCode = $this->subtrees[$key]->to_smarty_php();
-                    if ((preg_match('/^\s*<\?php\s+/', $newCode) && preg_match('/\s*\?>\s*$/', $subtree))) {
-                        $subtree = preg_replace('/\s*\?>\s*$/', "\n", $subtree);
-                        $subtree .= preg_replace('/^\s*<\?php\s+/', '', $newCode);
-                    } else {
-                        $subtree .= $newCode;
-                    }
+                    $subtree = $this->parser->compiler->appendCode($subtree, $this->subtrees[$key]->to_smarty_php());
                 }
                 if ($subtree == '') {
                     continue;
                 }
                 if ($subtree == '') {
                     continue;
index fb79660ffaa1d3604d990b32981141c0aad73f6e..42d5bd2992b5d1fcab0cf9ec65a01c02f5851661 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
 /**
 <?php
 
 /**
- * Smarty Internal Plugin Templateparser Parsetrees
- * These are classes to build parsetrees in the template parser
+ * Smarty Internal Plugin Templateparser Parse Tree
+ * These are classes to build parse tree in the template parser
  *
  * @package    Smarty
  * @subpackage Compiler
  *
  * @package    Smarty
  * @subpackage Compiler
index 7981315bdc66b4f89058909acea194845bc98d09..218428eedb01ebf5908aef10bc59066c8faa593b 100644 (file)
@@ -17,6 +17,7 @@
  */
 abstract class Smarty_Internal_TemplateCompilerBase
 {
  */
 abstract class Smarty_Internal_TemplateCompilerBase
 {
+
     /**
      * Smarty object
      *
     /**
      * Smarty object
      *
@@ -128,6 +129,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
      * @var string
      */
     public $trace_filepath = '';
      * @var string
      */
     public $trace_filepath = '';
+
     /**
      * stack for tracing file and line of nested {block} tags
      *
     /**
      * stack for tracing file and line of nested {block} tags
      *
@@ -205,6 +207,13 @@ abstract class Smarty_Internal_TemplateCompilerBase
      */
     public $templateFunctionCode = '';
 
      */
     public $templateFunctionCode = '';
 
+    /**
+     * php_handling setting either from Smarty or security
+     *
+     * @var int
+     */
+    public $php_handling = 0;
+
     /**
      * flags for used modifier plugins
      *
     /**
      * flags for used modifier plugins
      *
@@ -317,6 +326,13 @@ abstract class Smarty_Internal_TemplateCompilerBase
      */
     public function compileTemplate(Smarty_Internal_Template $template, $nocache = null, $parent_compiler = null)
     {
      */
     public function compileTemplate(Smarty_Internal_Template $template, $nocache = null, $parent_compiler = null)
     {
+        // save template object in compiler class
+        $this->template = $template;
+        if (isset($this->template->smarty->security_policy)) {
+            $this->php_handling = $this->template->smarty->security_policy->php_handling;
+        } else {
+            $this->php_handling = $this->template->smarty->php_handling;
+        }
         $this->parent_compiler = $parent_compiler ? $parent_compiler : $this;
         $nocache = isset($nocache) ? $nocache : false;
         if (empty($template->properties['nocache_hash'])) {
         $this->parent_compiler = $parent_compiler ? $parent_compiler : $this;
         $nocache = isset($nocache) ? $nocache : false;
         if (empty($template->properties['nocache_hash'])) {
@@ -327,8 +343,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
         // flag for nochache sections
         $this->nocache = $nocache;
         $this->tag_nocache = false;
         // flag for nochache sections
         $this->nocache = $nocache;
         $this->tag_nocache = false;
-        // save template object in compiler class
-        $this->template = $template;
         // reset has nocache code flag
         $this->template->has_nocache_code = false;
         $save_source = $this->template->source;
         // reset has nocache code flag
         $this->template->has_nocache_code = false;
         $save_source = $this->template->source;
@@ -361,6 +375,13 @@ abstract class Smarty_Internal_TemplateCompilerBase
                 $this->inheritance_child = false;
             }
             do {
                 $this->inheritance_child = false;
             }
             do {
+                // flag for nochache sections
+                $this->nocache = $nocache;
+                $this->tag_nocache = false;
+                // reset has nocache code flag
+                $this->template->has_nocache_code = false;
+                $this->has_variable_string = false;
+                $this->prefix_code = array();
                 $_compiled_code = '';
                 // flag for aborting current and start recompile
                 $this->abort_and_recompile = false;
                 $_compiled_code = '';
                 // flag for aborting current and start recompile
                 $this->abort_and_recompile = false;
@@ -466,8 +487,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
             $this->template->used_tags[] = array($tag, $args);
         }
         // check nocache option flag
             $this->template->used_tags[] = array($tag, $args);
         }
         // check nocache option flag
-        if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args)
-            || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)
+        if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args) || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)
         ) {
             $this->tag_nocache = true;
         }
         ) {
             $this->tag_nocache = true;
         }
@@ -507,8 +527,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
                 // check if tag is a registered object
                 if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_method'])) {
                     $method = $parameter['object_method'];
                 // check if tag is a registered object
                 if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_method'])) {
                     $method = $parameter['object_method'];
-                    if (!in_array($method, $this->smarty->registered_objects[$tag][3]) &&
-                        (empty($this->smarty->registered_objects[$tag][1]) || in_array($method, $this->smarty->registered_objects[$tag][1]))
+                    if (!in_array($method, $this->smarty->registered_objects[$tag][3]) && (empty($this->smarty->registered_objects[$tag][1]) || in_array($method, $this->smarty->registered_objects[$tag][1]))
                     ) {
                         return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method);
                     } elseif (in_array($method, $this->smarty->registered_objects[$tag][3])) {
                     ) {
                         return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method);
                     } elseif (in_array($method, $this->smarty->registered_objects[$tag][3])) {
@@ -703,9 +722,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
      */
     public function processText($text)
     {
      */
     public function processText($text)
     {
-        if ($this->inheritance_child && !$this->blockTagNestingLevel) {
-            return null;
-        }
         if ($this->parser->strip) {
             return new Smarty_Internal_ParseTree_Text($this->parser, preg_replace($this->stripRegEx, '', $text));
         } else {
         if ($this->parser->strip) {
             return new Smarty_Internal_ParseTree_Text($this->parser, preg_replace($this->stripRegEx, '', $text));
         } else {
@@ -820,9 +836,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
         $callback = null;
         $script = null;
         $cacheable = true;
         $callback = null;
         $script = null;
         $cacheable = true;
-        $result = call_user_func_array(
-            $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable)
-        );
+        $result = call_user_func_array($this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable));
         if ($result) {
             $this->tag_nocache = $this->tag_nocache || !$cacheable;
             if ($script !== null) {
         if ($result) {
             $this->tag_nocache = $this->tag_nocache || !$cacheable;
             if ($script !== null) {
@@ -854,6 +868,25 @@ abstract class Smarty_Internal_TemplateCompilerBase
         return false;
     }
 
         return false;
     }
 
+    /**
+     * Append code segments and remove unneeded ?> <?php transitions
+     *
+     * @param string $left
+     * @param string $right
+     *
+     * @return string
+     */
+    public function appendCode($left, $right)
+    {
+        if (preg_match('/\s*\?>\s*$/', $left) && preg_match('/^\s*<\?php\s+/', $right)) {
+            $left = preg_replace('/\s*\?>\s*$/', "\n", $left);
+            $left .= preg_replace('/^\s*<\?php\s+/', '', $right);
+        } else {
+            $left .= $right;
+        }
+        return $left;
+    }
+
     /**
      * Inject inline code for nocache template sections
      * This method gets the content of each template element from the parser.
     /**
      * Inject inline code for nocache template sections
      * This method gets the content of each template element from the parser.
@@ -870,8 +903,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
         // If the template is not evaluated and we have a nocache section and or a nocache tag
         if ($is_code && !empty($content)) {
             // generate replacement code
         // If the template is not evaluated and we have a nocache section and or a nocache tag
         if ($is_code && !empty($content)) {
             // generate replacement code
-            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&
-                ($this->nocache || $this->tag_nocache)
+            if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache)
             ) {
                 $this->template->has_nocache_code = true;
                 $_output = addcslashes($content, '\'\\');
             ) {
                 $this->template->has_nocache_code = true;
                 $_output = addcslashes($content, '\'\\');
index dfc21e146028f381b6cb4b7117a6685904d39d1a..9b0ade35b7ac8caf530643e6cefcb43c1928ebb4 100644 (file)
  */
 class Smarty_Internal_Templatelexer
 {
  */
 class Smarty_Internal_Templatelexer
 {
+
     /**
      * Source
      *
      * @var string
      */
     public $data;
     /**
      * Source
      *
      * @var string
      */
     public $data;
+
     /**
      * byte counter
      *
      * @var int
      */
     public $counter;
     /**
      * byte counter
      *
      * @var int
      */
     public $counter;
+
     /**
      * token number
      *
      * @var int
      */
     public $token;
     /**
      * token number
      *
      * @var int
      */
     public $token;
+
     /**
      * token value
      *
      * @var string
      */
     public $value;
     /**
      * token value
      *
      * @var string
      */
     public $value;
+
     /**
      * current line
      *
      * @var int
      */
     public $line;
     /**
      * current line
      *
      * @var int
      */
     public $line;
+
     /**
      * tag start line
      *
      * @var
      */
     public $taglineno;
     /**
      * tag start line
      *
      * @var
      */
     public $taglineno;
-    /**
-     * flag if parsing php script
-     *
-     * @var bool
-     */
-    public $is_phpScript = false;
+
     /**
      * php code type
      *
      * @var string
      */
     public $phpType = '';
     /**
      * php code type
      *
      * @var string
      */
     public $phpType = '';
+
     /**
      * escaped left delimiter
      *
      * @var string
      */
     public $ldel = '';
     /**
      * escaped left delimiter
      *
      * @var string
      */
     public $ldel = '';
+
     /**
      * escaped left delimiter length
      *
      * @var int
      */
     public $ldel_length = 0;
     /**
      * escaped left delimiter length
      *
      * @var int
      */
     public $ldel_length = 0;
+
     /**
      * escaped right delimiter
      *
      * @var string
      */
     public $rdel = '';
     /**
      * escaped right delimiter
      *
      * @var string
      */
     public $rdel = '';
+
     /**
      * escaped right delimiter length
      *
      * @var int
      */
     public $rdel_length = 0;
     /**
      * escaped right delimiter length
      *
      * @var int
      */
     public $rdel_length = 0;
+
     /**
      * state number
      *
      * @var int
      */
     public $state = 1;
     /**
      * state number
      *
      * @var int
      */
     public $state = 1;
+
     /**
      * Smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
     /**
      * Smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
+
     /**
      * compiler object
      *
      * @var Smarty_Internal_TemplateCompilerBase
      */
     /**
      * compiler object
      *
      * @var Smarty_Internal_TemplateCompilerBase
      */
-    private $compiler = null;
+    public $compiler = null;
+
     /**
      * literal tag nesting level
      *
      * @var int
      */
     private $literal_cnt = 0;
     /**
      * literal tag nesting level
      *
      * @var int
      */
     private $literal_cnt = 0;
+
+    /**
+     * PHP start tag string
+     *
+     * @var string
+     */
+
     /**
      * trace file
      *
      * @var resource
      */
     public $yyTraceFILE;
     /**
      * trace file
      *
      * @var resource
      */
     public $yyTraceFILE;
+
     /**
      * trace prompt
      *
      * @var string
      */
     /**
      * trace prompt
      *
      * @var string
      */
+
     public $yyTracePrompt;
     public $yyTracePrompt;
+
     /**
      * state names
      *
      * @var array
      */
     /**
      * state names
      *
      * @var array
      */
-    public $state_name = array(1 => 'TEXT', 2 => 'SMARTY', 3 => 'LITERAL', 4 => 'DOUBLEQUOTEDSTRING', 5 => 'CHILDBODY');
+    public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',
+                               6 => 'CHILDBODY', 7 => 'CHILDBLOCK', 8 => 'CHILDLITERAL');
+
+    /**
+     * storage for assembled token patterns
+     *
+     * @var string
+     */
+    private $yy_global_pattern1 = null;
+
+    private $yy_global_pattern2 = null;
+
+    private $yy_global_pattern3 = null;
+
+    private $yy_global_pattern4 = null;
+
+    private $yy_global_pattern5 = null;
+
+    private $yy_global_pattern6 = null;
+
+    private $yy_global_pattern7 = null;
+
+    private $yy_global_pattern8 = null;
+
     /**
      * token names
      *
      * @var array
      */
     public $smarty_token_names = array(        // Text for parser error messages
     /**
      * token names
      *
      * @var array
      */
     public $smarty_token_names = array(        // Text for parser error messages
-                                               'IDENTITY'        => '===',
-                                               'NONEIDENTITY'    => '!==',
-                                               'EQUALS'          => '==',
-                                               'NOTEQUALS'       => '!=',
-                                               'GREATEREQUAL'    => '(>=,ge)',
-                                               'LESSEQUAL'       => '(<=,le)',
-                                               'GREATERTHAN'     => '(>,gt)',
-                                               'LESSTHAN'        => '(<,lt)',
-                                               'MOD'             => '(%,mod)',
-                                               'NOT'             => '(!,not)',
-                                               'LAND'            => '(&&,and)',
-                                               'LOR'             => '(||,or)',
-                                               'LXOR'            => 'xor',
-                                               'OPENP'           => '(',
-                                               'CLOSEP'          => ')',
-                                               'OPENB'           => '[',
-                                               'CLOSEB'          => ']',
-                                               'PTR'             => '->',
-                                               'APTR'            => '=>',
-                                               'EQUAL'           => '=',
-                                               'NUMBER'          => 'number',
-                                               'UNIMATH'         => '+" , "-',
-                                               'MATH'            => '*" , "/" , "%',
-                                               'INCDEC'          => '++" , "--',
-                                               'SPACE'           => ' ',
-                                               'DOLLAR'          => '$',
-                                               'SEMICOLON'       => ';',
-                                               'COLON'           => ':',
-                                               'DOUBLECOLON'     => '::',
-                                               'AT'              => '@',
-                                               'HATCH'           => '#',
-                                               'QUOTE'           => '"',
-                                               'BACKTICK'        => '`',
-                                               'VERT'            => '|',
-                                               'DOT'             => '.',
-                                               'COMMA'           => '","',
-                                               'ANDSYM'          => '"&"',
-                                               'QMARK'           => '"?"',
-                                               'ID'              => 'identifier',
-                                               'TEXT'            => 'text',
-                                               'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
-                                               'PHPSTARTTAG'     => 'PHP start tag',
-                                               'PHPENDTAG'       => 'PHP end tag',
-                                               'LITERALSTART'    => 'Literal start',
-                                               'LITERALEND'      => 'Literal end',
-                                               'LDELSLASH'       => 'closing tag',
-                                               'COMMENT'         => 'comment',
-                                               'AS'              => 'as',
-                                               'TO'              => 'to',
-    );
+        'NOT'         => '(!,not)', 'OPENP' => '(', 'CLOSEP' => ')', 'OPENB' => '[', 'CLOSEB' => ']', 'PTR' => '->',
+        'APTR'        => '=>', 'EQUAL' => '=', 'NUMBER' => 'number', 'UNIMATH' => '+" , "-', 'MATH' => '*" , "/" , "%',
+        'INCDEC'      => '++" , "--', 'SPACE' => ' ', 'DOLLAR' => '$', 'SEMICOLON' => ';', 'COLON' => ':',
+        'DOUBLECOLON' => '::', 'AT' => '@', 'HATCH' => '#', 'QUOTE' => '"', 'BACKTICK' => '`', 'VERT' => '"|" modifier',
+        'DOT'         => '.', 'COMMA' => '","', 'QMARK' => '"?"', 'ID' => 'id, name', 'TEXT' => 'text',
+        'LDELSLASH'   => '{/..} closing tag', 'LDEL' => '{...} Smarty tag', 'COMMENT' => 'comment', 'AS' => 'as',
+        'TO'          => 'to', 'PHP' => '"<?php", "<%", "{php}" tag', 'LOGOP' => '"<", "==" ... logical operator',
+        'TLOGOP'      => '"lt", "eq" ... logical operator; "is div by" ... if condition',
+        'SCOND'       => '"is even" ... if condition',);
 
     /**
      * constructor
 
     /**
      * constructor
@@ -200,15 +201,15 @@ class Smarty_Internal_Templatelexer
     {
         $this->data = $data;
         $this->counter = 0;
     {
         $this->data = $data;
         $this->counter = 0;
-        if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) {
+        if (preg_match('~^\xEF\xBB\xBF~i', $this->data, $match)) {
             $this->counter += strlen($match[0]);
         }
         $this->line = 1;
         $this->smarty = $compiler->smarty;
         $this->compiler = $compiler;
             $this->counter += strlen($match[0]);
         }
         $this->line = 1;
         $this->smarty = $compiler->smarty;
         $this->compiler = $compiler;
-        $this->ldel = preg_quote($this->smarty->left_delimiter, '/');
+        $this->ldel = preg_quote($this->smarty->left_delimiter, '~');
         $this->ldel_length = strlen($this->smarty->left_delimiter);
         $this->ldel_length = strlen($this->smarty->left_delimiter);
-        $this->rdel = preg_quote($this->smarty->right_delimiter, '/');
+        $this->rdel = preg_quote($this->smarty->right_delimiter, '~');
         $this->rdel_length = strlen($this->smarty->right_delimiter);
         $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
         $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
         $this->rdel_length = strlen($this->smarty->right_delimiter);
         $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
         $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
@@ -220,7 +221,16 @@ class Smarty_Internal_Templatelexer
         $this->yyTracePrompt = '<br>';
     }
 
         $this->yyTracePrompt = '<br>';
     }
 
+    /*
+     * Check if this tag is autoliteral
+     */
+    public function isAutoLiteral()
+    {
+        return $this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false;
+    }
+
     private $_yy_state = 1;
     private $_yy_state = 1;
+
     private $_yy_stack = array();
 
     public function yylex()
     private $_yy_stack = array();
 
     public function yylex()
@@ -261,52 +271,24 @@ class Smarty_Internal_Templatelexer
 
     public function yylex1()
     {
 
     public function yylex1()
     {
-        $tokenMap = array(
-            1  => 0,
-            2  => 1,
-            4  => 0,
-            5  => 0,
-            6  => 0,
-            7  => 1,
-            9  => 0,
-            10 => 0,
-            11 => 0,
-            12 => 6,
-            19 => 0,
-            20 => 0,
-            21 => 0,
-            22 => 1,
-            24 => 6,
-            31 => 7,
-            39 => 6,
-            46 => 3,
-            50 => 0,
-        );
+        if (!isset($this->yy_global_pattern1)) {
+            $this->yy_global_pattern1 = "/\G([{][}])|\G(" . $this->ldel . "[*])|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|(<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|([?][>])|([%][>])|(" . $this->ldel . "\\s*php(.*?)" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(\\{\\})|\G(" . $this->ldel . "\\*([\S\s]*?)\\*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G((" . $this->ldel . "\\s*php\\s*(.)*?" . $this->rdel . "((.)*?)" . $this->ldel . "\\s*\/php\\s*" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]?php\\s*(.)*?" . $this->rdel . "))|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G(<\\?xml\\s+([\S\s]*?)\\?>)|\G(<%((('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")|(\/\\*(.)*?\\*\/)|.)*?)%>)|\G((<\\?(?:php\\s+|=)?)((('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")|(\/\\*(.)*?\\*\/)|.)*?)\\?>)|\G(<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>((('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")|(\/\\*(.)*?\\*\/)|.)*?)<\/script>)|\G((<(\\?(?:php\\s+|=)?|(script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|%))|\\?>|%>)|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state TEXT');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state TEXT');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r1_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -326,8 +308,7 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
             }
             break;
         } while (true);
@@ -335,39 +316,34 @@ class Smarty_Internal_Templatelexer
 
     const TEXT = 1;
 
 
     const TEXT = 1;
 
-    function yy_r1_1($yy_subpatterns)
+    function yy_r1_1()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
-    function yy_r1_2($yy_subpatterns)
+    function yy_r1_2()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
-    }
-
-    function yy_r1_4($yy_subpatterns)
-    {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+        preg_match("~[*]{$this->rdel}~", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        if (isset($match[0][1])) {
+            $to = $match[0][1] + strlen($match[0][0]);
         } else {
         } else {
-            $this->token = Smarty_Internal_Templateparser::TP_STRIPON;
+            $this->compiler->trigger_template_error("missing or misspelled comment closing tag '*{$this->smarty->right_delimiter}'");
         }
         }
+        $this->value = substr($this->data, $this->counter, $to - $this->counter);
+        return false;
     }
 
     }
 
-    function yy_r1_5($yy_subpatterns)
+    function yy_r1_3()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
-        }
+        $obj = new Smarty_Internal_Compile_Private_Php();
+        $obj->parsePhp($this);
+        $this->token = Smarty_Internal_Templateparser::TP_PHP;
     }
 
     }
 
-    function yy_r1_6($yy_subpatterns)
+    function yy_r1_15()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -378,243 +354,174 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r1_7($yy_subpatterns)
+    function yy_r1_16()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+            $this->yypushstate(self::TAG);
+            return true;
         }
     }
 
         }
     }
 
-    function yy_r1_9($yy_subpatterns)
+    function yy_r1_17()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
+        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     }
 
-    function yy_r1_10($yy_subpatterns)
+    function yy_r1_18()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+        $to = strlen($this->data);
+        preg_match("~($this->ldel)|([<]script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*[>])|([<][?])|([<][%])|([?][>])|([%][>])~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        if (isset($match[0][1])) {
+            $to = $match[0][1];
         }
         }
+        $this->value = substr($this->data, $this->counter, $to - $this->counter);
+        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     }
 
-    function yy_r1_11($yy_subpatterns)
+    public function yylex2()
     {
     {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+        if (!isset($this->yy_global_pattern2)) {
+            $this->yy_global_pattern2 = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*setfilter\\s+)|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*)/isS";
+        }
+        if ($this->counter >= strlen($this->data)) {
+            return false; // end of input
         }
         }
-    }
 
 
-    function yy_r1_12($yy_subpatterns)
-    {
+        do {
+            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, null, $this->counter)) {
+                $yysubmatches = $yymatches;
+                $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state TAG');
+                }
+                next($yymatches); // skip global match
+                $this->token = key($yymatches); // token number
+                $this->value = current($yymatches); // token value
+                $r = $this->{'yy_r2_' . $this->token}();
+                if ($r === null) {
+                    $this->counter += strlen($this->value);
+                    $this->line += substr_count($this->value, "\n");
+                    // accept this token
+                    return true;
+                } elseif ($r === true) {
+                    // we have changed state
+                    // process this token in the new state
+                    return $this->yylex();
+                } elseif ($r === false) {
+                    $this->counter += strlen($this->value);
+                    $this->line += substr_count($this->value, "\n");
+                    if ($this->counter >= strlen($this->data)) {
+                        return false; // end of input
+                    }
+                    // skip this token
+                    continue;
+                }
+            } else {
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
+            }
+            break;
+        } while (true);
+    } // end function
 
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_PHP;
-            $this->phpType = 'tag';
-            $this->taglineno = $this->line;
-        }
-    }
+    const TAG = 2;
 
 
-    function yy_r1_19($yy_subpatterns)
+    function yy_r2_1()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
+        $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+        $this->yybegin(self::TAGBODY);
+        $this->taglineno = $this->line;
     }
 
     }
 
-    function yy_r1_20($yy_subpatterns)
+    function yy_r2_3()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDEL;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
+        $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+        $this->yybegin(self::TAGBODY);
+        $this->taglineno = $this->line;
     }
 
     }
 
-    function yy_r1_21($yy_subpatterns)
+    function yy_r2_4()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+        $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+        $this->yybegin(self::TAGBODY);
+        $this->taglineno = $this->line;
     }
 
     }
 
-    function yy_r1_22($yy_subpatterns)
+    function yy_r2_5()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
+        $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
+        $this->yybegin(self::TAGBODY);
         $this->taglineno = $this->line;
     }
 
         $this->taglineno = $this->line;
     }
 
-    function yy_r1_24($yy_subpatterns)
+    function yy_r2_6()
     {
 
     {
 
-        $this->phpType = 'asp';
+        $this->yypopstate();
+        $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG;
         $this->taglineno = $this->line;
         $this->taglineno = $this->line;
-        $this->token = Smarty_Internal_Templateparser::TP_PHP;
     }
 
     }
 
-    function yy_r1_31($yy_subpatterns)
+    function yy_r2_8()
     {
 
     {
 
-        $this->phpType = 'php';
+        $this->yypopstate();
+        $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG;
         $this->taglineno = $this->line;
         $this->taglineno = $this->line;
-        $this->token = Smarty_Internal_Templateparser::TP_PHP;
     }
 
     }
 
-    function yy_r1_39($yy_subpatterns)
+    function yy_r2_9()
     {
 
     {
 
-        $this->phpType = 'script';
+        $this->yypopstate();
+        $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT;
         $this->taglineno = $this->line;
         $this->taglineno = $this->line;
-        $this->token = Smarty_Internal_Templateparser::TP_PHP;
     }
 
     }
 
-    function yy_r1_46($yy_subpatterns)
+    function yy_r2_11()
     {
 
     {
 
-        $this->phpType = 'unmatched';
+        $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+        $this->yybegin(self::TAGBODY);
         $this->taglineno = $this->line;
         $this->taglineno = $this->line;
-        $this->token = Smarty_Internal_Templateparser::TP_PHP;
     }
 
     }
 
-    function yy_r1_50($yy_subpatterns)
+    function yy_r2_12()
     {
 
     {
 
-        $to = strlen($this->data);
-        preg_match("/{$this->ldel}|<\?|<%|\?>|%>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
-        if (isset($match[0][1])) {
-            $to = $match[0][1];
-        }
-        $this->value = substr($this->data, $this->counter, $to - $this->counter);
-        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
+        $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+        $this->yybegin(self::TAGBODY);
+        $this->taglineno = $this->line;
     }
 
     }
 
-    public function yylex2()
+    public function yylex3()
     {
     {
-        $tokenMap = array(
-            1  => 0,
-            2  => 0,
-            3  => 1,
-            5  => 0,
-            6  => 0,
-            7  => 0,
-            8  => 0,
-            9  => 0,
-            10 => 0,
-            11 => 0,
-            12 => 0,
-            13 => 0,
-            14 => 0,
-            15 => 1,
-            17 => 1,
-            19 => 1,
-            21 => 0,
-            22 => 0,
-            23 => 0,
-            24 => 0,
-            25 => 0,
-            26 => 0,
-            27 => 0,
-            28 => 0,
-            29 => 0,
-            30 => 0,
-            31 => 0,
-            32 => 0,
-            33 => 0,
-            34 => 0,
-            35 => 0,
-            36 => 0,
-            37 => 0,
-            38 => 3,
-            42 => 0,
-            43 => 0,
-            44 => 0,
-            45 => 0,
-            46 => 0,
-            47 => 0,
-            48 => 0,
-            49 => 0,
-            50 => 1,
-            52 => 1,
-            54 => 0,
-            55 => 0,
-            56 => 0,
-            57 => 2,
-            60 => 0,
-            61 => 0,
-            62 => 0,
-            63 => 0,
-            64 => 0,
-            65 => 0,
-            66 => 0,
-            67 => 0,
-            68 => 0,
-            69 => 0,
-            70 => 0,
-            71 => 0,
-            72 => 0,
-            73 => 1,
-            75 => 0,
-            76 => 0,
-            77 => 0,
-            78 => 0,
-            79 => 0,
-        );
+        if (!isset($this->yy_global_pattern3)) {
+            $this->yy_global_pattern3 = "/\G(\\s*" . $this->rdel . ")|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\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|neg|gt|ge|gte|lt|le|lte|mod|and|or|xor|(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([#])|\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(" . $this->ldel . "\\s*)|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G(\\$)|\G(\\s*" . $this->rdel . ")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\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(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(@)|\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*;)|\G(::)|\G(\\s*:\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state SMARTY');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state TAGBODY     ');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r3_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -634,300 +541,191 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const SMARTY = 2;
+    const TAGBODY = 3;
+
+    function yy_r3_1()
+    {
+
+        $this->token = Smarty_Internal_Templateparser::TP_RDEL;
+        $this->yypopstate();
+    }
 
 
-    function yy_r2_1($yy_subpatterns)
+    function yy_r3_2()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
         $this->yypushstate(self::DOUBLEQUOTEDSTRING);
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
         $this->yypushstate(self::DOUBLEQUOTEDSTRING);
     }
 
-    function yy_r2_2($yy_subpatterns)
+    function yy_r3_3()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
     }
 
-    function yy_r2_3($yy_subpatterns)
+    function yy_r3_4()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;
         $this->taglineno = $this->line;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;
         $this->taglineno = $this->line;
     }
 
-    function yy_r2_5($yy_subpatterns)
+    function yy_r3_6()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
+        $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
     }
 
     }
 
-    function yy_r2_6($yy_subpatterns)
+    function yy_r3_7()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_RDEL;
-        $this->yypopstate();
+        $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
     }
 
     }
 
-    function yy_r2_7($yy_subpatterns)
+    function yy_r3_8()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_ISIN;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_ISIN;
     }
 
-    function yy_r2_8($yy_subpatterns)
+    function yy_r3_9()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_AS;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_AS;
     }
 
-    function yy_r2_9($yy_subpatterns)
+    function yy_r3_10()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TO;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TO;
     }
 
-    function yy_r2_10($yy_subpatterns)
+    function yy_r3_11()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_STEP;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_STEP;
     }
 
-    function yy_r2_11($yy_subpatterns)
+    function yy_r3_12()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
     }
 
-    function yy_r2_12($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
-    }
-
-    function yy_r2_13($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
-    }
-
-    function yy_r2_14($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_EQUALS;
-    }
-
-    function yy_r2_15($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
-    }
-
-    function yy_r2_17($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
-    }
-
-    function yy_r2_19($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
-    }
-
-    function yy_r2_21($yy_subpatterns)
+    function yy_r3_13()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
+        $this->token = Smarty_Internal_Templateparser::TP_LOGOP;
     }
 
     }
 
-    function yy_r2_22($yy_subpatterns)
+    function yy_r3_18()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
+        $this->token = Smarty_Internal_Templateparser::TP_TLOGOP;
     }
 
     }
 
-    function yy_r2_23($yy_subpatterns)
+    function yy_r3_23()
     {
 
     {
 
-        $this->token = Smarty_Internal_Templateparser::TP_MOD;
+        $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND;
     }
 
     }
 
-    function yy_r2_24($yy_subpatterns)
+    function yy_r3_26()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_NOT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_NOT;
     }
 
-    function yy_r2_25($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_LAND;
-    }
-
-    function yy_r2_26($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_LOR;
-    }
-
-    function yy_r2_27($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_LXOR;
-    }
-
-    function yy_r2_28($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
-    }
-
-    function yy_r2_29($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
-    }
-
-    function yy_r2_30($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISODD;
-    }
-
-    function yy_r2_31($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
-    }
-
-    function yy_r2_32($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
-    }
-
-    function yy_r2_33($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
-    }
-
-    function yy_r2_34($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
-    }
-
-    function yy_r2_35($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
-    }
-
-    function yy_r2_36($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
-    }
-
-    function yy_r2_37($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
-    }
-
-    function yy_r2_38($yy_subpatterns)
+    function yy_r3_29()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
     }
 
-    function yy_r2_42($yy_subpatterns)
+    function yy_r3_33()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_OPENP;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_OPENP;
     }
 
-    function yy_r2_43($yy_subpatterns)
+    function yy_r3_34()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
     }
 
-    function yy_r2_44($yy_subpatterns)
+    function yy_r3_35()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_OPENB;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_OPENB;
     }
 
-    function yy_r2_45($yy_subpatterns)
+    function yy_r3_36()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
     }
 
-    function yy_r2_46($yy_subpatterns)
+    function yy_r3_37()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_PTR;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_PTR;
     }
 
-    function yy_r2_47($yy_subpatterns)
+    function yy_r3_38()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_APTR;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_APTR;
     }
 
-    function yy_r2_48($yy_subpatterns)
+    function yy_r3_39()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
     }
 
-    function yy_r2_49($yy_subpatterns)
+    function yy_r3_40()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
     }
 
-    function yy_r2_50($yy_subpatterns)
+    function yy_r3_42()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
     }
 
-    function yy_r2_52($yy_subpatterns)
+    function yy_r3_44()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_MATH;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_MATH;
     }
 
-    function yy_r2_54($yy_subpatterns)
+    function yy_r3_46()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_AT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_AT;
     }
 
-    function yy_r2_55($yy_subpatterns)
+    function yy_r3_47()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_HATCH;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_HATCH;
     }
 
-    function yy_r2_56($yy_subpatterns)
+    function yy_r3_48()
     {
 
         // resolve conflicts with shorttag and right_delimiter starting with '='
         if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) {
     {
 
         // resolve conflicts with shorttag and right_delimiter starting with '='
         if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->rdel_length) == $this->smarty->right_delimiter) {
-            preg_match("/\s+/", $this->value, $match);
+            preg_match("~\s+~", $this->value, $match);
             $this->value = $match[0];
             $this->token = Smarty_Internal_Templateparser::TP_SPACE;
         } else {
             $this->value = $match[0];
             $this->token = Smarty_Internal_Templateparser::TP_SPACE;
         } else {
@@ -935,189 +733,122 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r2_57($yy_subpatterns)
+    function yy_r3_49()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE;
     }
 
-    function yy_r2_60($yy_subpatterns)
+    function yy_r3_52()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_ID;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_ID;
     }
 
-    function yy_r2_61($yy_subpatterns)
+    function yy_r3_53()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
     }
 
-    function yy_r2_62($yy_subpatterns)
+    function yy_r3_54()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
         $this->yypopstate();
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
         $this->yypopstate();
     }
 
-    function yy_r2_63($yy_subpatterns)
+    function yy_r3_55()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_VERT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_VERT;
     }
 
-    function yy_r2_64($yy_subpatterns)
+    function yy_r3_56()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOT;
     }
 
-    function yy_r2_65($yy_subpatterns)
+    function yy_r3_57()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_COMMA;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_COMMA;
     }
 
-    function yy_r2_66($yy_subpatterns)
+    function yy_r3_58()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
     }
 
-    function yy_r2_67($yy_subpatterns)
+    function yy_r3_59()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
     }
 
-    function yy_r2_68($yy_subpatterns)
+    function yy_r3_60()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_COLON;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_COLON;
     }
 
-    function yy_r2_69($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
-    }
-
-    function yy_r2_70($yy_subpatterns)
+    function yy_r3_61()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QMARK;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QMARK;
     }
 
-    function yy_r2_71($yy_subpatterns)
+    function yy_r3_62()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_HEX;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_HEX;
     }
 
-    function yy_r2_72($yy_subpatterns)
+    function yy_r3_63()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SPACE;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_SPACE;
     }
 
-    function yy_r2_73($yy_subpatterns)
+    function yy_r3_64()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
-    }
-
-    function yy_r2_75($yy_subpatterns)
-    {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
-    }
-
-    function yy_r2_76($yy_subpatterns)
-    {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
-    }
-
-    function yy_r2_77($yy_subpatterns)
-    {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
-    }
-
-    function yy_r2_78($yy_subpatterns)
-    {
-
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDEL;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+            $this->yypushstate(self::TAG);
+            return true;
         }
     }
 
         }
     }
 
-    function yy_r2_79($yy_subpatterns)
+    function yy_r3_65()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
-    public function yylex3()
+    public function yylex4()
     {
     {
-        $tokenMap = array(
-            1 => 0,
-            2 => 0,
-            3 => 0,
-        );
+        if (!isset($this->yy_global_pattern4)) {
+            $this->yy_global_pattern4 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state LITERAL');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state LITERAL');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r4_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -1137,23 +868,22 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const LITERAL = 3;
+    const LITERAL = 4;
 
 
-    function yy_r3_1($yy_subpatterns)
+    function yy_r4_1()
     {
 
         $this->literal_cnt ++;
         $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
     }
 
     {
 
         $this->literal_cnt ++;
         $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
     }
 
-    function yy_r3_2($yy_subpatterns)
+    function yy_r4_2()
     {
 
         if ($this->literal_cnt) {
     {
 
         if ($this->literal_cnt) {
@@ -1165,11 +895,11 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r3_3($yy_subpatterns)
+    function yy_r4_3()
     {
 
         $to = strlen($this->data);
     {
 
         $to = strlen($this->data);
-        preg_match("/{$this->ldel}\/?literal{$this->rdel}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        preg_match("~{$this->ldel}[/]?literal{$this->rdel}~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
         if (isset($match[0][1])) {
             $to = $match[0][1];
         } else {
         if (isset($match[0][1])) {
             $to = $match[0][1];
         } else {
@@ -1179,48 +909,26 @@ class Smarty_Internal_Templatelexer
         $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
     }
 
         $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
     }
 
-    public function yylex4()
+    public function yylex5()
     {
     {
-        $tokenMap = array(
-            1  => 1,
-            3  => 0,
-            4  => 0,
-            5  => 0,
-            6  => 0,
-            7  => 0,
-            8  => 0,
-            9  => 0,
-            10 => 0,
-            11 => 0,
-            12 => 0,
-            13 => 3,
-            17 => 0,
-        );
+        if (!isset($this->yy_global_pattern5)) {
+            $this->yy_global_pattern5 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/])|\G(" . $this->ldel . "\\s*[0-9]*[a-zA-Z_]\\w*)|\G(" . $this->ldel . "\\s*)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(" . $this->ldel . "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel . "\\s*for\\s+)|\G(" . $this->ldel . "\\s*foreach(?![^\s]))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/)|\G(" . $this->ldel . "\\s*)|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel . "|\\$|`\\$|\")))|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r5_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -1240,122 +948,95 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const DOUBLEQUOTEDSTRING = 4;
+    const DOUBLEQUOTEDSTRING = 5;
 
 
-    function yy_r4_1($yy_subpatterns)
+    function yy_r5_1()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
+        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     }
 
-    function yy_r4_3($yy_subpatterns)
+    function yy_r5_2()
     {
 
     {
 
-        if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
-            $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-        } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
-        }
+        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     }
 
-    function yy_r4_4($yy_subpatterns)
+    function yy_r5_3()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+            $this->yypushstate(self::TAG);
+            return true;
         }
     }
 
         }
     }
 
-    function yy_r4_5($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-    }
-
-    function yy_r4_6($yy_subpatterns)
-    {
-
-        $this->token = Smarty_Internal_Templateparser::TP_TEXT;
-    }
-
-    function yy_r4_7($yy_subpatterns)
+    function yy_r5_4()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
-            $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
-            $this->yypushstate(self::SMARTY);
-            $this->taglineno = $this->line;
+            $this->yypushstate(self::TAG);
+            return true;
         }
     }
 
         }
     }
 
-    function yy_r4_8($yy_subpatterns)
+    function yy_r5_5()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
             $this->token = Smarty_Internal_Templateparser::TP_LDEL;
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
             $this->token = Smarty_Internal_Templateparser::TP_TEXT;
         } else {
             $this->token = Smarty_Internal_Templateparser::TP_LDEL;
-            $this->yypushstate(self::SMARTY);
             $this->taglineno = $this->line;
             $this->taglineno = $this->line;
+            $this->yypushstate(self::TAGBODY);
         }
     }
 
         }
     }
 
-    function yy_r4_9($yy_subpatterns)
+    function yy_r5_6()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
         $this->yypopstate();
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
         $this->yypopstate();
     }
 
-    function yy_r4_10($yy_subpatterns)
+    function yy_r5_7()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
         $this->value = substr($this->value, 0, - 1);
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
         $this->value = substr($this->value, 0, - 1);
-        $this->yypushstate(self::SMARTY);
+        $this->yypushstate(self::TAGBODY);
         $this->taglineno = $this->line;
     }
 
         $this->taglineno = $this->line;
     }
 
-    function yy_r4_11($yy_subpatterns)
+    function yy_r5_8()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
     }
 
-    function yy_r4_12($yy_subpatterns)
+    function yy_r5_9()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
-    function yy_r4_13($yy_subpatterns)
+    function yy_r5_10()
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
     {
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
-    function yy_r4_17($yy_subpatterns)
+    function yy_r5_14()
     {
 
         $to = strlen($this->data);
     {
 
         $to = strlen($this->data);
@@ -1363,39 +1044,26 @@ class Smarty_Internal_Templatelexer
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
         $this->token = Smarty_Internal_Templateparser::TP_TEXT;
     }
 
-    public function yylex5()
+    public function yylex6()
     {
     {
-        $tokenMap = array(
-            1 => 0,
-            2 => 0,
-            3 => 0,
-            4 => 0,
-        );
+        if (!isset($this->yy_global_pattern6)) {
+            $this->yy_global_pattern6 = "/\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(" . $this->ldel . "\\s*strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/strip\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state CHILDBODY');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state CHILDBODY');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r5_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r6_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -1415,16 +1083,15 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const CHILDBODY = 5;
+    const CHILDBODY = 6;
 
 
-    function yy_r5_1($yy_subpatterns)
+    function yy_r6_1()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1434,7 +1101,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r5_2($yy_subpatterns)
+    function yy_r6_2()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1444,7 +1111,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r5_3($yy_subpatterns)
+    function yy_r6_3()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1455,11 +1122,11 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r5_4($yy_subpatterns)
+    function yy_r6_4()
     {
 
         $to = strlen($this->data);
     {
 
         $to = strlen($this->data);
-        preg_match("/" . $this->ldel . "\s*((\/)?strip\s*" . $this->rdel . "|block\s+)/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        preg_match("~" . $this->ldel . "\s*(([/])?strip\s*" . $this->rdel . "|block\s+)~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
         if (isset($match[0][1])) {
             $to = $match[0][1];
         }
         if (isset($match[0][1])) {
             $to = $match[0][1];
         }
@@ -1467,40 +1134,26 @@ class Smarty_Internal_Templatelexer
         return false;
     }
 
         return false;
     }
 
-    public function yylex6()
+    public function yylex7()
     {
     {
-        $tokenMap = array(
-            1 => 0,
-            2 => 0,
-            3 => 0,
-            4 => 1,
-            6 => 0,
-        );
+        if (!isset($this->yy_global_pattern7)) {
+            $this->yy_global_pattern7 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G(" . $this->ldel . "\\s*[\/]block)|\G(" . $this->ldel . "\\s*[$]smarty\\.block\\.(child|parent))|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*block)|\G(" . $this->ldel . "\\s*\/block)|\G(" . $this->ldel . "\\s*[$]smarty\\.block\\.(child|parent))|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern7, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state CHILDBLOCK');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state CHILDBLOCK');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r6_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r7_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -1520,16 +1173,15 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const CHILDBLOCK = 6;
+    const CHILDBLOCK = 7;
 
 
-    function yy_r6_1($yy_subpatterns)
+    function yy_r7_1()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1540,7 +1192,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r6_2($yy_subpatterns)
+    function yy_r7_2()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1551,7 +1203,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r6_3($yy_subpatterns)
+    function yy_r7_3()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1562,7 +1214,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r6_4($yy_subpatterns)
+    function yy_r7_4()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1573,11 +1225,11 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r6_6($yy_subpatterns)
+    function yy_r7_6()
     {
 
         $to = strlen($this->data);
     {
 
         $to = strlen($this->data);
-        preg_match("/" . $this->ldel . "\s*(literal\s*" . $this->rdel . "|(\/)?block(\s|" . $this->rdel . ")|[\$]smarty\.block\.(child|parent))/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        preg_match("~" . $this->ldel . "\s*(literal\s*" . $this->rdel . "|([/])?block(\s|" . $this->rdel . ")|[\$]smarty\.block\.(child|parent))~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
         if (isset($match[0][1])) {
             $to = $match[0][1];
         }
         if (isset($match[0][1])) {
             $to = $match[0][1];
         }
@@ -1585,38 +1237,26 @@ class Smarty_Internal_Templatelexer
         $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
     }
 
         $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
     }
 
-    public function yylex7()
+    public function yylex8()
     {
     {
-        $tokenMap = array(
-            1 => 0,
-            2 => 0,
-            3 => 0,
-        );
+        if (!isset($this->yy_global_pattern8)) {
+            $this->yy_global_pattern8 = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*[\/]literal\\s*" . $this->rdel . ")|\G([\S\s])/isS";
+        }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
         if ($this->counter >= strlen($this->data)) {
             return false; // end of input
         }
-        $yy_global_pattern = "/\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*\/literal\\s*" . $this->rdel . ")|\G([\S\s])/iS";
 
         do {
 
         do {
-            if (preg_match($yy_global_pattern, $this->data, $yymatches, null, $this->counter)) {
+            if (preg_match($this->yy_global_pattern8, $this->data, $yymatches, null, $this->counter)) {
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
                 $yysubmatches = $yymatches;
                 $yymatches = preg_grep("/(.|\s)+/", $yysubmatches);
-                if (!count($yymatches)) {
-                    throw new Exception('Error: lexing failed because a rule matched' .
-                                        ' an empty string.  Input "' . substr($this->data,
-                                                                              $this->counter, 5) . '... state CHILDLITERAL');
+                if (empty($yymatches)) {
+                    throw new Exception('Error: lexing failed because a rule matched' . ' an empty string.  Input "' . substr($this->data, $this->counter, 5) . '... state CHILDLITERAL');
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
                 }
                 next($yymatches); // skip global match
                 $this->token = key($yymatches); // token number
-                if ($tokenMap[$this->token]) {
-                    // extract sub-patterns for passing to lex function
-                    $yysubmatches = array_slice($yysubmatches, $this->token + 1,
-                                                $tokenMap[$this->token]);
-                } else {
-                    $yysubmatches = array();
-                }
                 $this->value = current($yymatches); // token value
                 $this->value = current($yymatches); // token value
-                $r = $this->{'yy_r7_' . $this->token}($yysubmatches);
+                $r = $this->{'yy_r8_' . $this->token}();
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
                 if ($r === null) {
                     $this->counter += strlen($this->value);
                     $this->line += substr_count($this->value, "\n");
@@ -1636,16 +1276,15 @@ class Smarty_Internal_Templatelexer
                     continue;
                 }
             } else {
                     continue;
                 }
             } else {
-                throw new Exception('Unexpected input at line' . $this->line .
-                                    ': ' . $this->data[$this->counter]);
+                throw new Exception('Unexpected input at line' . $this->line . ': ' . $this->data[$this->counter]);
             }
             break;
         } while (true);
     } // end function
 
             }
             break;
         } while (true);
     } // end function
 
-    const CHILDLITERAL = 7;
+    const CHILDLITERAL = 8;
 
 
-    function yy_r7_1($yy_subpatterns)
+    function yy_r8_1()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1656,7 +1295,7 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r7_2($yy_subpatterns)
+    function yy_r8_2()
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
     {
 
         if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -1667,11 +1306,11 @@ class Smarty_Internal_Templatelexer
         }
     }
 
         }
     }
 
-    function yy_r7_3($yy_subpatterns)
+    function yy_r8_3()
     {
 
         $to = strlen($this->data);
     {
 
         $to = strlen($this->data);
-        preg_match("/{$this->ldel}\/?literal\s*{$this->rdel}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
+        preg_match("~{$this->ldel}[/]?literal\s*{$this->rdel}~i", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
         if (isset($match[0][1])) {
             $to = $match[0][1];
         } else {
         if (isset($match[0][1])) {
             $to = $match[0][1];
         } else {
index 0a11c35ea70568aef61dc5f99613b0f830e367a4..b09c53c41ecfb71c9e895d9cbe10f54378594456 100644 (file)
@@ -1,7 +1,10 @@
 <?php
 <?php
+
 class TP_yyToken implements ArrayAccess
 {
 class TP_yyToken implements ArrayAccess
 {
+
     public $string = '';
     public $string = '';
+
     public $metadata = array();
 
     public function __construct($s, $m = array())
     public $metadata = array();
 
     public function __construct($s, $m = array())
@@ -38,8 +41,7 @@ class TP_yyToken implements ArrayAccess
     {
         if ($offset === null) {
             if (isset($value[0])) {
     {
         if ($offset === null) {
             if (isset($value[0])) {
-                $x = ($value instanceof TP_yyToken) ?
-                    $value->metadata : $value;
+                $x = ($value instanceof TP_yyToken) ? $value->metadata : $value;
                 $this->metadata = array_merge($this->metadata, $x);
 
                 return;
                 $this->metadata = array_merge($this->metadata, $x);
 
                 return;
@@ -66,12 +68,14 @@ class TP_yyToken implements ArrayAccess
 
 class TP_yyStackEntry
 {
 
 class TP_yyStackEntry
 {
+
     public $stateno;       /* The state-number */
     public $major;         /* The major token value.  This is the code
                      ** number for the token at this stack level */
     public $minor; /* The user-supplied minor token value.  This
                      ** is the value of the token  */
 }
     public $stateno;       /* The state-number */
     public $major;         /* The major token value.  This is the code
                      ** number for the token at this stack level */
     public $minor; /* The user-supplied minor token value.  This
                      ** is the value of the token  */
 }
+
 ;
 
 #line 13 "../smarty/lexer/smarty_internal_templateparser.y"
 ;
 
 #line 13 "../smarty/lexer/smarty_internal_templateparser.y"
@@ -88,10 +92,13 @@ class TP_yyStackEntry
  */
 class Smarty_Internal_Templateparser
 {
  */
 class Smarty_Internal_Templateparser
 {
+
     #line 26 "../smarty/lexer/smarty_internal_templateparser.y"
 
     const Err1 = "Security error: Call to private object member not allowed";
     #line 26 "../smarty/lexer/smarty_internal_templateparser.y"
 
     const Err1 = "Security error: Call to private object member not allowed";
+
     const Err2 = "Security error: Call to dynamic object member not allowed";
     const Err2 = "Security error: Call to dynamic object member not allowed";
+
     const Err3 = "PHP in template not allowed. Use SmartyBC to enable it";
 
     /**
     const Err3 = "PHP in template not allowed. Use SmartyBC to enable it";
 
     /**
@@ -100,82 +107,96 @@ class Smarty_Internal_Templateparser
      * @var bool
      */
     public $successful = true;
      * @var bool
      */
     public $successful = true;
+
     /**
      * return value
      *
      * @var mixed
      */
     public $retvalue = 0;
     /**
      * return value
      *
      * @var mixed
      */
     public $retvalue = 0;
+
     /**
      * counter for prefix code
      *
      * @var int
      */
     public static $prefix_number = 0;
     /**
      * counter for prefix code
      *
      * @var int
      */
     public static $prefix_number = 0;
+
     /**
      * @var
      */
     public $yymajor;
     /**
      * @var
      */
     public $yymajor;
+
     /**
      * last index of array variable
      *
      * @var mixed
      */
     public $last_index;
     /**
      * last index of array variable
      *
      * @var mixed
      */
     public $last_index;
+
     /**
      * last variable name
      *
      * @var string
      */
     public $last_variable;
     /**
      * last variable name
      *
      * @var string
      */
     public $last_variable;
+
     /**
      * root parse tree buffer
      *
      * @var Smarty_Internal_ParseTree
      */
     public $root_buffer;
     /**
      * root parse tree buffer
      *
      * @var Smarty_Internal_ParseTree
      */
     public $root_buffer;
+
     /**
      * current parse tree object
      *
      * @var Smarty_Internal_ParseTree
      */
     public $current_buffer;
     /**
      * current parse tree object
      *
      * @var Smarty_Internal_ParseTree
      */
     public $current_buffer;
+
     /**
      * lexer object
      *
      * @var Smarty_Internal_Templatelexer
      */
     private $lex;
     /**
      * lexer object
      *
      * @var Smarty_Internal_Templatelexer
      */
     private $lex;
+
     /**
      * internal error flag
      *
      * @var bool
      */
     private $internalError = false;
     /**
      * internal error flag
      *
      * @var bool
      */
     private $internalError = false;
+
     /**
      * {strip} status
      *
      * @var bool
      */
     public $strip = false;
     /**
      * {strip} status
      *
      * @var bool
      */
     public $strip = false;
+
     /**
      * compiler object
      *
      * @var Smarty_Internal_TemplateCompilerBase
      */
     public $compiler = null;
     /**
      * compiler object
      *
      * @var Smarty_Internal_TemplateCompilerBase
      */
     public $compiler = null;
+
     /**
      * smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
     /**
      * smarty object
      *
      * @var Smarty
      */
     public $smarty = null;
+
     /**
      * template object
      *
      * @var Smarty_Internal_Template
      */
     public $template = null;
     /**
      * template object
      *
      * @var Smarty_Internal_Template
      */
     public $template = null;
+
     /**
      * block nesting level
      *
     /**
      * block nesting level
      *
@@ -190,13 +211,6 @@ class Smarty_Internal_Templateparser
      */
     private $security = null;
 
      */
     private $security = null;
 
-    /**
-     * PHP tag handling mode
-     *
-     * @var int
-     */
-    private $php_handling = 0;
-
     /**
      * constructor
      *
     /**
      * constructor
      *
@@ -209,13 +223,7 @@ class Smarty_Internal_Templateparser
         $this->compiler = $compiler;
         $this->template = $this->compiler->template;
         $this->smarty = $this->template->smarty;
         $this->compiler = $compiler;
         $this->template = $this->compiler->template;
         $this->smarty = $this->template->smarty;
-        $this->compiler->has_variable_string = false;
-        $this->compiler->prefix_code = array();
-        if ($this->security = isset($this->smarty->security_policy)) {
-            $this->php_handling = $this->smarty->security_policy->php_handling;
-        } else {
-            $this->php_handling = $this->smarty->php_handling;
-        }
+        $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false;
         $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template($this);
     }
 
         $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template($this);
     }
 
@@ -229,1012 +237,488 @@ class Smarty_Internal_Templateparser
         $this->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($this, $code));
     }
 
         $this->current_buffer->append_subtree(new Smarty_Internal_ParseTree_Tag($this, $code));
     }
 
+    /**
+     *  merge PHP code with prefix code and return parse tree tag object
+     *
+     * @param string $code
+     *
+     * @return Smarty_Internal_ParseTree_Tag
+     */
+    public function mergePrefixCode($code)
+    {
+        $tmp = '';
+        foreach ($this->compiler->prefix_code as $preCode) {
+            $tmp = empty($tmp) ? $preCode : $this->compiler->appendCode($tmp, $preCode);
+        }
+        $this->compiler->prefix_code = array();
+        $tmp = empty($tmp) ? $code : $this->compiler->appendCode($tmp, $code);
+        return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));
+    }
+
     const TP_VERT = 1;
     const TP_VERT = 1;
+
     const TP_COLON = 2;
     const TP_COLON = 2;
-    const TP_RDEL = 3;
-    const TP_COMMENT = 4;
-    const TP_PHP = 5;
-    const TP_XMLTAG = 6;
-    const TP_TEXT = 7;
-    const TP_STRIPON = 8;
-    const TP_STRIPOFF = 9;
-    const TP_BLOCKSOURCE = 10;
-    const TP_LITERALSTART = 11;
-    const TP_LITERALEND = 12;
-    const TP_LITERAL = 13;
-    const TP_LDEL = 14;
-    const TP_DOLLAR = 15;
-    const TP_ID = 16;
-    const TP_EQUAL = 17;
+
+    const TP_PHP = 3;
+
+    const TP_TEXT = 4;
+
+    const TP_STRIPON = 5;
+
+    const TP_STRIPOFF = 6;
+
+    const TP_BLOCKSOURCE = 7;
+
+    const TP_LITERALSTART = 8;
+
+    const TP_LITERALEND = 9;
+
+    const TP_LITERAL = 10;
+
+    const TP_RDEL = 11;
+
+    const TP_SIMPELOUTPUT = 12;
+
+    const TP_LDEL = 13;
+
+    const TP_DOLLARID = 14;
+
+    const TP_EQUAL = 15;
+
+    const TP_SIMPLETAG = 16;
+
+    const TP_ID = 17;
+
     const TP_PTR = 18;
     const TP_PTR = 18;
+
     const TP_LDELIF = 19;
     const TP_LDELIF = 19;
+
     const TP_LDELFOR = 20;
     const TP_LDELFOR = 20;
+
     const TP_SEMICOLON = 21;
     const TP_SEMICOLON = 21;
+
     const TP_INCDEC = 22;
     const TP_INCDEC = 22;
+
     const TP_TO = 23;
     const TP_TO = 23;
+
     const TP_STEP = 24;
     const TP_STEP = 24;
+
     const TP_LDELFOREACH = 25;
     const TP_LDELFOREACH = 25;
+
     const TP_SPACE = 26;
     const TP_SPACE = 26;
+
     const TP_AS = 27;
     const TP_AS = 27;
+
     const TP_APTR = 28;
     const TP_APTR = 28;
+
     const TP_LDELSETFILTER = 29;
     const TP_LDELSETFILTER = 29;
+
     const TP_SMARTYBLOCKCHILDPARENT = 30;
     const TP_SMARTYBLOCKCHILDPARENT = 30;
-    const TP_LDELSLASH = 31;
-    const TP_ATTR = 32;
-    const TP_INTEGER = 33;
-    const TP_COMMA = 34;
-    const TP_OPENP = 35;
-    const TP_CLOSEP = 36;
-    const TP_MATH = 37;
-    const TP_UNIMATH = 38;
-    const TP_ANDSYM = 39;
+
+    const TP_CLOSETAG = 31;
+
+    const TP_LDELSLASH = 32;
+
+    const TP_ATTR = 33;
+
+    const TP_INTEGER = 34;
+
+    const TP_COMMA = 35;
+
+    const TP_OPENP = 36;
+
+    const TP_CLOSEP = 37;
+
+    const TP_MATH = 38;
+
+    const TP_UNIMATH = 39;
+
     const TP_ISIN = 40;
     const TP_ISIN = 40;
-    const TP_ISDIVBY = 41;
-    const TP_ISNOTDIVBY = 42;
-    const TP_ISEVEN = 43;
-    const TP_ISNOTEVEN = 44;
-    const TP_ISEVENBY = 45;
-    const TP_ISNOTEVENBY = 46;
-    const TP_ISODD = 47;
-    const TP_ISNOTODD = 48;
-    const TP_ISODDBY = 49;
-    const TP_ISNOTODDBY = 50;
-    const TP_INSTANCEOF = 51;
-    const TP_QMARK = 52;
-    const TP_NOT = 53;
-    const TP_TYPECAST = 54;
-    const TP_HEX = 55;
-    const TP_DOT = 56;
-    const TP_SINGLEQUOTESTRING = 57;
-    const TP_DOUBLECOLON = 58;
-    const TP_NAMESPACE = 59;
-    const TP_AT = 60;
-    const TP_HATCH = 61;
-    const TP_OPENB = 62;
-    const TP_CLOSEB = 63;
-    const TP_EQUALS = 64;
-    const TP_NOTEQUALS = 65;
-    const TP_GREATERTHAN = 66;
-    const TP_LESSTHAN = 67;
-    const TP_GREATEREQUAL = 68;
-    const TP_LESSEQUAL = 69;
-    const TP_IDENTITY = 70;
-    const TP_NONEIDENTITY = 71;
-    const TP_MOD = 72;
-    const TP_LAND = 73;
-    const TP_LOR = 74;
-    const TP_LXOR = 75;
-    const TP_QUOTE = 76;
-    const TP_BACKTICK = 77;
-    const TP_DOLLARID = 78;
-    const YY_NO_ACTION = 564;
-    const YY_ACCEPT_ACTION = 563;
-    const YY_ERROR_ACTION = 562;
-
-    const YY_SZ_ACTTAB = 2263;
-    static public $yy_action = array(
-        218, 147, 326, 198, 325, 308, 304, 301, 303, 309,
-        310, 316, 201, 329, 340, 9, 288, 34, 348, 264,
-        5, 108, 201, 318, 311, 43, 123, 35, 126, 175,
-        251, 28, 250, 193, 127, 327, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        563, 91, 268, 247, 305, 246, 306, 247, 305, 246,
-        244, 206, 286, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 218, 188, 147, 328, 23,
-        106, 299, 43, 336, 23, 313, 299, 13, 28, 230,
-        8, 43, 24, 249, 348, 5, 108, 28, 37, 161,
-        43, 123, 218, 207, 425, 251, 28, 250, 313, 195,
-        325, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 207, 425, 248, 23,
-        240, 299, 29, 425, 238, 252, 227, 272, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        43, 202, 323, 25, 338, 218, 28, 419, 122, 20,
-        158, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 218, 263, 425, 206,
-        43, 477, 34, 23, 262, 299, 28, 3, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        139, 425, 232, 218, 477, 422, 23, 425, 299, 278,
-        121, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 162, 269, 422, 254,
-        218, 40, 140, 295, 422, 313, 127, 231, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        294, 15, 240, 23, 218, 299, 13, 21, 477, 41,
-        158, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 99, 160, 218, 43,
-        382, 477, 106, 477, 314, 28, 313, 315, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        139, 196, 218, 43, 206, 296, 477, 190, 325, 28,
-        257, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 214, 203, 4, 206,
-        478, 34, 10, 360, 218, 36, 387, 32, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        181, 164, 489, 478, 218, 45, 6, 332, 489, 313,
-        313, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 235, 207, 207, 23,
-        189, 299, 135, 317, 23, 117, 233, 194, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        137, 298, 131, 23, 23, 261, 242, 23, 206, 225,
-        275, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 173, 27, 300, 234,
-        260, 297, 116, 28, 136, 111, 97, 229, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        298, 298, 298, 320, 238, 243, 238, 271, 207, 166,
-        145, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 218, 330, 172, 168, 197,
-        300, 319, 192, 107, 16, 133, 313, 274, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        103, 167, 6, 270, 159, 128, 280, 287, 199, 98,
-        313, 49, 51, 46, 44, 31, 38, 346, 345, 39,
-        42, 342, 343, 17, 12, 298, 293, 171, 206, 7,
-        154, 235, 241, 145, 290, 158, 313, 281, 344, 279,
-        350, 351, 357, 358, 359, 356, 355, 352, 353, 354,
-        218, 331, 165, 200, 258, 101, 169, 20, 266, 152,
-        144, 313, 68, 115, 243, 313, 11, 33, 11, 33,
-        191, 283, 341, 214, 300, 213, 217, 282, 292, 10,
-        348, 206, 228, 206, 124, 120, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        218, 105, 182, 170, 289, 205, 22, 267, 307, 186,
-        302, 313, 313, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 300, 256, 339, 183, 206,
-        158, 95, 312, 300, 296, 102, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        218, 298, 204, 184, 277, 286, 176, 185, 273, 45,
-        100, 157, 313, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 300, 298, 298, 104, 245,
-        14, 187, 326, 326, 326, 326, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        218, 18, 326, 163, 349, 326, 326, 326, 326, 326,
-        326, 130, 313, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 300, 300, 326, 326, 326,
-        326, 326, 326, 326, 326, 158, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        218, 326, 326, 326, 326, 326, 326, 326, 326, 326,
-        113, 118, 326, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 139, 298, 298, 326, 326,
-        326, 326, 326, 326, 326, 326, 49, 51, 46, 44,
-        31, 38, 346, 345, 39, 42, 342, 343, 17, 12,
-        326, 229, 326, 326, 326, 326, 326, 326, 326, 326,
-        326, 326, 326, 344, 279, 350, 351, 357, 358, 359,
-        356, 355, 352, 353, 354, 49, 51, 46, 44, 31,
-        38, 346, 345, 39, 42, 342, 343, 17, 12, 109,
-        335, 326, 326, 326, 326, 326, 326, 326, 326, 326,
-        326, 326, 344, 279, 350, 351, 357, 358, 359, 356,
-        355, 352, 353, 354, 326, 326, 241, 9, 141, 92,
-        326, 326, 5, 108, 326, 326, 326, 23, 123, 299,
-        336, 30, 251, 321, 250, 326, 236, 8, 26, 43,
-        326, 48, 5, 108, 326, 28, 326, 326, 123, 23,
-        326, 299, 251, 285, 250, 285, 47, 50, 284, 239,
-        291, 43, 219, 255, 106, 1, 479, 28, 479, 326,
-        218, 9, 134, 212, 326, 326, 5, 108, 326, 96,
-        326, 326, 123, 326, 93, 326, 251, 237, 250, 479,
-        236, 479, 26, 200, 180, 48, 326, 326, 326, 324,
-        25, 338, 326, 313, 326, 326, 11, 33, 326, 326,
-        47, 50, 284, 239, 291, 326, 219, 326, 106, 1,
-        265, 206, 326, 326, 326, 9, 134, 221, 326, 326,
-        5, 108, 258, 96, 326, 326, 123, 146, 326, 326,
-        251, 138, 250, 326, 236, 326, 26, 200, 178, 48,
-        347, 326, 326, 215, 217, 282, 292, 313, 348, 326,
-        11, 33, 326, 326, 47, 50, 284, 239, 291, 326,
-        219, 326, 106, 1, 326, 206, 326, 326, 326, 9,
-        127, 221, 326, 258, 5, 108, 326, 96, 156, 326,
-        123, 326, 138, 326, 251, 326, 250, 326, 236, 326,
-        19, 276, 326, 48, 215, 217, 282, 292, 326, 348,
-        326, 326, 326, 326, 326, 200, 174, 326, 47, 50,
-        284, 239, 291, 326, 219, 313, 106, 1, 11, 33,
-        326, 326, 326, 9, 134, 209, 326, 258, 5, 108,
-        326, 96, 155, 206, 123, 326, 138, 326, 251, 326,
-        250, 326, 226, 326, 26, 200, 177, 48, 215, 217,
-        282, 292, 326, 348, 326, 313, 326, 326, 11, 33,
-        326, 326, 47, 50, 284, 239, 291, 326, 219, 326,
-        106, 1, 326, 206, 326, 326, 326, 9, 134, 216,
-        326, 258, 5, 108, 326, 96, 148, 326, 123, 326,
-        138, 326, 251, 326, 250, 326, 236, 326, 26, 200,
-        179, 48, 215, 217, 282, 292, 326, 348, 326, 313,
-        326, 326, 11, 33, 326, 326, 47, 50, 284, 239,
-        291, 326, 219, 326, 106, 1, 326, 206, 326, 326,
-        326, 9, 132, 221, 326, 258, 5, 108, 326, 96,
-        151, 326, 123, 326, 138, 326, 251, 326, 250, 326,
-        236, 326, 2, 326, 326, 48, 215, 217, 282, 292,
-        326, 348, 326, 326, 326, 326, 326, 326, 326, 326,
-        47, 50, 284, 239, 291, 326, 219, 326, 106, 1,
-        326, 326, 326, 326, 326, 9, 129, 221, 326, 258,
-        5, 108, 326, 96, 150, 326, 123, 326, 138, 326,
-        251, 326, 250, 326, 236, 326, 26, 326, 326, 48,
-        215, 217, 282, 292, 326, 348, 326, 326, 326, 326,
-        326, 326, 326, 326, 47, 50, 284, 239, 291, 326,
-        219, 326, 106, 1, 326, 326, 326, 326, 326, 9,
-        134, 208, 326, 258, 5, 108, 326, 96, 153, 326,
-        123, 326, 138, 326, 251, 326, 250, 326, 236, 326,
-        26, 326, 326, 48, 215, 217, 282, 292, 326, 348,
-        326, 326, 326, 326, 326, 326, 326, 326, 47, 50,
-        284, 239, 291, 326, 219, 326, 106, 1, 326, 326,
-        326, 326, 326, 9, 127, 221, 326, 258, 5, 108,
-        326, 96, 149, 326, 123, 326, 138, 326, 251, 326,
-        250, 326, 236, 326, 19, 326, 423, 48, 215, 217,
-        282, 292, 326, 348, 326, 322, 326, 326, 326, 326,
-        259, 326, 47, 50, 284, 239, 291, 326, 219, 423,
-        106, 326, 258, 326, 285, 423, 326, 125, 477, 326,
-        73, 138, 218, 326, 392, 96, 326, 479, 326, 283,
-        341, 326, 326, 213, 217, 282, 292, 467, 348, 253,
-        326, 477, 326, 93, 326, 326, 326, 43, 224, 334,
-        479, 326, 326, 28, 326, 467, 477, 467, 467, 326,
-        467, 467, 326, 326, 326, 326, 467, 326, 467, 477,
-        467, 326, 326, 326, 326, 326, 326, 326, 326, 477,
-        326, 326, 326, 326, 326, 326, 258, 326, 326, 326,
-        326, 152, 477, 326, 71, 138, 326, 467, 326, 326,
-        326, 326, 326, 283, 341, 326, 326, 213, 217, 282,
-        292, 467, 348, 258, 326, 326, 326, 326, 125, 220,
-        326, 73, 138, 326, 326, 326, 326, 285, 326, 326,
-        283, 341, 326, 326, 213, 217, 282, 292, 326, 348,
-        479, 326, 326, 326, 258, 326, 326, 326, 326, 152,
-        333, 326, 71, 138, 326, 326, 93, 326, 326, 326,
-        326, 283, 341, 479, 326, 213, 217, 282, 292, 326,
-        348, 326, 326, 326, 326, 258, 326, 223, 326, 326,
-        152, 326, 337, 71, 138, 326, 326, 326, 326, 326,
-        326, 326, 283, 341, 326, 258, 213, 217, 282, 292,
-        152, 348, 326, 57, 115, 143, 258, 326, 222, 326,
-        326, 152, 283, 341, 87, 138, 213, 217, 282, 292,
-        326, 348, 326, 283, 341, 326, 326, 213, 217, 282,
-        292, 326, 348, 258, 326, 326, 326, 326, 152, 326,
-        326, 75, 138, 326, 326, 326, 326, 326, 326, 326,
-        283, 341, 326, 326, 213, 217, 282, 292, 326, 348,
-        326, 258, 326, 326, 326, 326, 152, 326, 326, 67,
-        138, 326, 326, 326, 326, 326, 326, 326, 283, 341,
-        326, 258, 213, 217, 282, 292, 152, 348, 326, 69,
-        138, 326, 258, 326, 326, 326, 326, 152, 283, 341,
-        84, 138, 213, 217, 282, 292, 326, 348, 326, 283,
-        341, 326, 258, 213, 217, 282, 292, 152, 348, 326,
-        72, 138, 326, 326, 326, 326, 326, 326, 326, 283,
-        341, 326, 326, 213, 217, 282, 292, 326, 348, 258,
-        326, 326, 326, 326, 152, 326, 326, 88, 138, 326,
-        258, 326, 326, 326, 326, 152, 283, 341, 86, 138,
-        213, 217, 282, 292, 326, 348, 326, 283, 341, 326,
-        258, 213, 217, 282, 292, 94, 348, 326, 52, 119,
-        326, 258, 326, 326, 326, 326, 152, 283, 341, 68,
-        138, 210, 217, 282, 292, 326, 348, 326, 283, 341,
-        326, 258, 213, 217, 282, 292, 152, 348, 326, 66,
-        138, 326, 326, 326, 326, 326, 326, 326, 283, 341,
-        326, 326, 213, 217, 282, 292, 326, 348, 258, 326,
-        326, 326, 326, 94, 326, 326, 55, 119, 326, 258,
-        326, 326, 326, 326, 152, 283, 341, 60, 138, 213,
-        217, 282, 292, 326, 348, 326, 283, 341, 326, 258,
-        213, 217, 282, 292, 152, 348, 326, 53, 138, 326,
-        258, 326, 326, 326, 326, 152, 283, 341, 89, 138,
-        213, 217, 282, 292, 326, 348, 326, 283, 341, 326,
-        258, 213, 217, 282, 292, 152, 348, 326, 90, 138,
-        326, 326, 326, 326, 326, 326, 326, 283, 341, 326,
-        326, 213, 217, 282, 292, 326, 348, 258, 326, 326,
-        326, 326, 152, 326, 326, 59, 138, 326, 258, 326,
-        326, 326, 326, 142, 283, 341, 56, 138, 211, 217,
-        282, 292, 326, 348, 326, 283, 341, 326, 258, 213,
-        217, 282, 292, 152, 348, 326, 70, 138, 326, 258,
-        326, 326, 326, 326, 152, 283, 341, 65, 138, 213,
-        217, 282, 292, 326, 348, 326, 283, 341, 326, 258,
-        213, 217, 282, 292, 152, 348, 326, 58, 138, 326,
-        326, 326, 326, 326, 326, 326, 283, 341, 326, 326,
-        213, 217, 282, 292, 326, 348, 258, 326, 326, 326,
-        326, 152, 326, 326, 81, 138, 326, 258, 326, 326,
-        326, 326, 114, 283, 341, 80, 138, 213, 217, 282,
-        292, 326, 348, 326, 283, 341, 326, 258, 213, 217,
-        282, 292, 112, 348, 326, 74, 138, 326, 258, 326,
-        326, 326, 326, 152, 283, 341, 85, 138, 213, 217,
-        282, 292, 326, 348, 326, 283, 341, 326, 258, 213,
-        217, 282, 292, 152, 348, 326, 79, 138, 326, 326,
-        326, 326, 326, 326, 326, 283, 341, 326, 326, 213,
-        217, 282, 292, 326, 348, 258, 326, 326, 326, 326,
-        152, 326, 326, 77, 138, 326, 258, 326, 326, 326,
-        326, 152, 283, 341, 62, 138, 213, 217, 282, 292,
-        326, 348, 326, 283, 341, 326, 258, 213, 217, 282,
-        292, 152, 348, 326, 83, 138, 326, 258, 326, 326,
-        326, 326, 152, 283, 341, 76, 138, 213, 217, 282,
-        292, 326, 348, 326, 283, 341, 326, 258, 213, 217,
-        282, 292, 152, 348, 326, 64, 138, 326, 326, 326,
-        326, 326, 326, 326, 283, 341, 326, 326, 213, 217,
-        282, 292, 326, 348, 258, 326, 326, 326, 326, 152,
-        326, 326, 63, 138, 326, 258, 326, 326, 326, 326,
-        110, 283, 341, 61, 138, 213, 217, 282, 292, 326,
-        348, 326, 283, 341, 326, 258, 213, 217, 282, 292,
-        152, 348, 326, 82, 138, 326, 258, 326, 326, 326,
-        326, 152, 283, 341, 54, 138, 213, 217, 282, 292,
-        326, 348, 326, 283, 341, 326, 258, 213, 217, 282,
-        292, 152, 348, 326, 78, 138, 326, 326, 326, 326,
-        326, 326, 326, 283, 341, 326, 326, 213, 217, 282,
-        292, 326, 348,
-    );
-    static public $yy_lookahead = array(
-        1, 92, 3, 113, 114, 4, 5, 6, 7, 8,
-        9, 10, 11, 104, 105, 14, 16, 34, 109, 36,
-        19, 20, 11, 12, 13, 26, 25, 14, 15, 16,
-        29, 32, 31, 89, 15, 16, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        80, 81, 82, 83, 84, 85, 82, 83, 84, 85,
-        60, 117, 118, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 1, 90, 92, 59, 14,
-        61, 16, 26, 7, 14, 99, 16, 17, 32, 104,
-        14, 26, 2, 28, 109, 19, 20, 32, 24, 90,
-        26, 25, 1, 117, 3, 29, 32, 31, 99, 113,
-        114, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 117, 26, 27, 14,
-        60, 16, 17, 32, 92, 93, 94, 22, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        26, 89, 76, 77, 78, 1, 32, 3, 15, 17,
-        18, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 1, 3, 3, 117,
-        26, 35, 34, 14, 36, 16, 32, 35, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        58, 26, 56, 1, 58, 3, 14, 32, 16, 63,
-        58, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 90, 3, 26, 60,
-        1, 14, 15, 16, 32, 99, 15, 16, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        33, 28, 60, 14, 1, 16, 17, 28, 35, 17,
-        18, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 89, 90, 1, 26,
-        3, 58, 61, 35, 84, 32, 99, 87, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        58, 89, 1, 26, 117, 111, 58, 113, 114, 32,
-        36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 56, 3, 34, 117,
-        35, 34, 62, 36, 1, 14, 3, 17, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        90, 90, 56, 58, 1, 2, 35, 63, 62, 99,
-        99, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 56, 117, 117, 14,
-        89, 16, 15, 12, 14, 96, 16, 21, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        34, 112, 35, 14, 14, 16, 16, 14, 117, 16,
-        36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 110, 26, 112, 15,
-        16, 16, 86, 32, 96, 96, 96, 83, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        112, 112, 112, 108, 92, 93, 92, 93, 117, 110,
-        115, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 1, 122, 90, 110, 98,
-        112, 3, 98, 98, 52, 15, 99, 63, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        89, 90, 35, 16, 110, 16, 33, 16, 16, 96,
-        99, 37, 38, 39, 40, 41, 42, 43, 44, 45,
-        46, 47, 48, 49, 50, 112, 108, 90, 117, 35,
-        16, 56, 2, 115, 16, 18, 99, 33, 64, 65,
-        66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
-        1, 77, 90, 89, 83, 89, 90, 17, 36, 88,
-        15, 99, 91, 92, 93, 99, 102, 103, 102, 103,
-        21, 100, 101, 56, 112, 104, 105, 106, 107, 62,
-        109, 117, 16, 117, 15, 15, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        1, 89, 90, 90, 16, 16, 23, 63, 3, 61,
-        7, 99, 99, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 112, 27, 3, 61, 117,
-        18, 16, 99, 112, 111, 96, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        1, 112, 3, 90, 26, 118, 110, 110, 115, 2,
-        96, 96, 99, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 112, 112, 112, 110, 95,
-        95, 110, 123, 123, 123, 123, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        1, 2, 123, 90, 114, 123, 123, 123, 123, 123,
-        123, 97, 99, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 112, 112, 123, 123, 123,
-        123, 123, 123, 123, 123, 18, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        1, 123, 123, 123, 123, 123, 123, 123, 123, 123,
-        96, 96, 123, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 58, 112, 112, 123, 123,
-        123, 123, 123, 123, 123, 123, 37, 38, 39, 40,
-        41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        123, 83, 123, 123, 123, 123, 123, 123, 123, 123,
-        123, 123, 123, 64, 65, 66, 67, 68, 69, 70,
-        71, 72, 73, 74, 75, 37, 38, 39, 40, 41,
-        42, 43, 44, 45, 46, 47, 48, 49, 50, 121,
-        122, 123, 123, 123, 123, 123, 123, 123, 123, 123,
-        123, 123, 64, 65, 66, 67, 68, 69, 70, 71,
-        72, 73, 74, 75, 123, 123, 2, 14, 15, 16,
-        123, 123, 19, 20, 123, 123, 123, 14, 25, 16,
-        7, 17, 29, 30, 31, 123, 33, 14, 35, 26,
-        123, 38, 19, 20, 123, 32, 123, 123, 25, 14,
-        123, 16, 29, 22, 31, 22, 53, 54, 55, 56,
-        57, 26, 59, 28, 61, 62, 35, 32, 35, 123,
-        1, 14, 15, 16, 123, 123, 19, 20, 123, 76,
-        123, 123, 25, 123, 51, 123, 29, 18, 31, 58,
-        33, 58, 35, 89, 90, 38, 123, 123, 123, 76,
-        77, 78, 123, 99, 123, 123, 102, 103, 123, 123,
-        53, 54, 55, 56, 57, 123, 59, 123, 61, 62,
-        63, 117, 123, 123, 123, 14, 15, 16, 123, 123,
-        19, 20, 83, 76, 123, 123, 25, 88, 123, 123,
-        29, 92, 31, 123, 33, 123, 35, 89, 90, 38,
-        101, 123, 123, 104, 105, 106, 107, 99, 109, 123,
-        102, 103, 123, 123, 53, 54, 55, 56, 57, 123,
-        59, 123, 61, 62, 123, 117, 123, 123, 123, 14,
-        15, 16, 123, 83, 19, 20, 123, 76, 88, 123,
-        25, 123, 92, 123, 29, 123, 31, 123, 33, 123,
-        35, 101, 123, 38, 104, 105, 106, 107, 123, 109,
-        123, 123, 123, 123, 123, 89, 90, 123, 53, 54,
-        55, 56, 57, 123, 59, 99, 61, 62, 102, 103,
-        123, 123, 123, 14, 15, 16, 123, 83, 19, 20,
-        123, 76, 88, 117, 25, 123, 92, 123, 29, 123,
-        31, 123, 33, 123, 35, 89, 90, 38, 104, 105,
-        106, 107, 123, 109, 123, 99, 123, 123, 102, 103,
-        123, 123, 53, 54, 55, 56, 57, 123, 59, 123,
-        61, 62, 123, 117, 123, 123, 123, 14, 15, 16,
-        123, 83, 19, 20, 123, 76, 88, 123, 25, 123,
-        92, 123, 29, 123, 31, 123, 33, 123, 35, 89,
-        90, 38, 104, 105, 106, 107, 123, 109, 123, 99,
-        123, 123, 102, 103, 123, 123, 53, 54, 55, 56,
-        57, 123, 59, 123, 61, 62, 123, 117, 123, 123,
-        123, 14, 15, 16, 123, 83, 19, 20, 123, 76,
-        88, 123, 25, 123, 92, 123, 29, 123, 31, 123,
-        33, 123, 35, 123, 123, 38, 104, 105, 106, 107,
-        123, 109, 123, 123, 123, 123, 123, 123, 123, 123,
-        53, 54, 55, 56, 57, 123, 59, 123, 61, 62,
-        123, 123, 123, 123, 123, 14, 15, 16, 123, 83,
-        19, 20, 123, 76, 88, 123, 25, 123, 92, 123,
-        29, 123, 31, 123, 33, 123, 35, 123, 123, 38,
-        104, 105, 106, 107, 123, 109, 123, 123, 123, 123,
-        123, 123, 123, 123, 53, 54, 55, 56, 57, 123,
-        59, 123, 61, 62, 123, 123, 123, 123, 123, 14,
-        15, 16, 123, 83, 19, 20, 123, 76, 88, 123,
-        25, 123, 92, 123, 29, 123, 31, 123, 33, 123,
-        35, 123, 123, 38, 104, 105, 106, 107, 123, 109,
-        123, 123, 123, 123, 123, 123, 123, 123, 53, 54,
-        55, 56, 57, 123, 59, 123, 61, 62, 123, 123,
-        123, 123, 123, 14, 15, 16, 123, 83, 19, 20,
-        123, 76, 88, 123, 25, 123, 92, 123, 29, 123,
-        31, 123, 33, 123, 35, 123, 3, 38, 104, 105,
-        106, 107, 123, 109, 123, 3, 123, 123, 123, 123,
-        17, 123, 53, 54, 55, 56, 57, 123, 59, 26,
-        61, 123, 83, 123, 22, 32, 123, 88, 35, 123,
-        91, 92, 1, 123, 3, 76, 123, 35, 123, 100,
-        101, 123, 123, 104, 105, 106, 107, 3, 109, 18,
-        123, 58, 123, 51, 123, 123, 123, 26, 119, 120,
-        58, 123, 123, 32, 123, 21, 35, 23, 24, 123,
-        26, 27, 123, 123, 123, 123, 32, 123, 34, 35,
-        36, 123, 123, 123, 123, 123, 123, 123, 123, 58,
-        123, 123, 123, 123, 123, 123, 83, 123, 123, 123,
-        123, 88, 58, 123, 91, 92, 123, 63, 123, 123,
-        123, 123, 123, 100, 101, 123, 123, 104, 105, 106,
-        107, 77, 109, 83, 123, 123, 123, 123, 88, 116,
-        123, 91, 92, 123, 123, 123, 123, 22, 123, 123,
-        100, 101, 123, 123, 104, 105, 106, 107, 123, 109,
-        35, 123, 123, 123, 83, 123, 123, 123, 123, 88,
-        120, 123, 91, 92, 123, 123, 51, 123, 123, 123,
-        123, 100, 101, 58, 123, 104, 105, 106, 107, 123,
-        109, 123, 123, 123, 123, 83, 123, 116, 123, 123,
-        88, 123, 77, 91, 92, 123, 123, 123, 123, 123,
-        123, 123, 100, 101, 123, 83, 104, 105, 106, 107,
-        88, 109, 123, 91, 92, 93, 83, 123, 116, 123,
-        123, 88, 100, 101, 91, 92, 104, 105, 106, 107,
-        123, 109, 123, 100, 101, 123, 123, 104, 105, 106,
-        107, 123, 109, 83, 123, 123, 123, 123, 88, 123,
-        123, 91, 92, 123, 123, 123, 123, 123, 123, 123,
-        100, 101, 123, 123, 104, 105, 106, 107, 123, 109,
-        123, 83, 123, 123, 123, 123, 88, 123, 123, 91,
-        92, 123, 123, 123, 123, 123, 123, 123, 100, 101,
-        123, 83, 104, 105, 106, 107, 88, 109, 123, 91,
-        92, 123, 83, 123, 123, 123, 123, 88, 100, 101,
-        91, 92, 104, 105, 106, 107, 123, 109, 123, 100,
-        101, 123, 83, 104, 105, 106, 107, 88, 109, 123,
-        91, 92, 123, 123, 123, 123, 123, 123, 123, 100,
-        101, 123, 123, 104, 105, 106, 107, 123, 109, 83,
-        123, 123, 123, 123, 88, 123, 123, 91, 92, 123,
-        83, 123, 123, 123, 123, 88, 100, 101, 91, 92,
-        104, 105, 106, 107, 123, 109, 123, 100, 101, 123,
-        83, 104, 105, 106, 107, 88, 109, 123, 91, 92,
-        123, 83, 123, 123, 123, 123, 88, 100, 101, 91,
-        92, 104, 105, 106, 107, 123, 109, 123, 100, 101,
-        123, 83, 104, 105, 106, 107, 88, 109, 123, 91,
-        92, 123, 123, 123, 123, 123, 123, 123, 100, 101,
-        123, 123, 104, 105, 106, 107, 123, 109, 83, 123,
-        123, 123, 123, 88, 123, 123, 91, 92, 123, 83,
-        123, 123, 123, 123, 88, 100, 101, 91, 92, 104,
-        105, 106, 107, 123, 109, 123, 100, 101, 123, 83,
-        104, 105, 106, 107, 88, 109, 123, 91, 92, 123,
-        83, 123, 123, 123, 123, 88, 100, 101, 91, 92,
-        104, 105, 106, 107, 123, 109, 123, 100, 101, 123,
-        83, 104, 105, 106, 107, 88, 109, 123, 91, 92,
-        123, 123, 123, 123, 123, 123, 123, 100, 101, 123,
-        123, 104, 105, 106, 107, 123, 109, 83, 123, 123,
-        123, 123, 88, 123, 123, 91, 92, 123, 83, 123,
-        123, 123, 123, 88, 100, 101, 91, 92, 104, 105,
-        106, 107, 123, 109, 123, 100, 101, 123, 83, 104,
-        105, 106, 107, 88, 109, 123, 91, 92, 123, 83,
-        123, 123, 123, 123, 88, 100, 101, 91, 92, 104,
-        105, 106, 107, 123, 109, 123, 100, 101, 123, 83,
-        104, 105, 106, 107, 88, 109, 123, 91, 92, 123,
-        123, 123, 123, 123, 123, 123, 100, 101, 123, 123,
-        104, 105, 106, 107, 123, 109, 83, 123, 123, 123,
-        123, 88, 123, 123, 91, 92, 123, 83, 123, 123,
-        123, 123, 88, 100, 101, 91, 92, 104, 105, 106,
-        107, 123, 109, 123, 100, 101, 123, 83, 104, 105,
-        106, 107, 88, 109, 123, 91, 92, 123, 83, 123,
-        123, 123, 123, 88, 100, 101, 91, 92, 104, 105,
-        106, 107, 123, 109, 123, 100, 101, 123, 83, 104,
-        105, 106, 107, 88, 109, 123, 91, 92, 123, 123,
-        123, 123, 123, 123, 123, 100, 101, 123, 123, 104,
-        105, 106, 107, 123, 109, 83, 123, 123, 123, 123,
-        88, 123, 123, 91, 92, 123, 83, 123, 123, 123,
-        123, 88, 100, 101, 91, 92, 104, 105, 106, 107,
-        123, 109, 123, 100, 101, 123, 83, 104, 105, 106,
-        107, 88, 109, 123, 91, 92, 123, 83, 123, 123,
-        123, 123, 88, 100, 101, 91, 92, 104, 105, 106,
-        107, 123, 109, 123, 100, 101, 123, 83, 104, 105,
-        106, 107, 88, 109, 123, 91, 92, 123, 123, 123,
-        123, 123, 123, 123, 100, 101, 123, 123, 104, 105,
-        106, 107, 123, 109, 83, 123, 123, 123, 123, 88,
-        123, 123, 91, 92, 123, 83, 123, 123, 123, 123,
-        88, 100, 101, 91, 92, 104, 105, 106, 107, 123,
-        109, 123, 100, 101, 123, 83, 104, 105, 106, 107,
-        88, 109, 123, 91, 92, 123, 83, 123, 123, 123,
-        123, 88, 100, 101, 91, 92, 104, 105, 106, 107,
-        123, 109, 123, 100, 101, 123, 83, 104, 105, 106,
-        107, 88, 109, 123, 91, 92, 123, 123, 123, 123,
-        123, 123, 123, 100, 101, 123, 123, 104, 105, 106,
-        107, 123, 109,
-    );
-    const YY_SHIFT_USE_DFLT = - 18;
-    const YY_SHIFT_MAX = 261;
-    static public $yy_shift_ofst = array(
-        1, 1123, 1177, 961, 1123, 1177, 961, 961, 853, 853,
-        907, 961, 961, 961, 961, 961, 1231, 961, 961, 961,
-        961, 961, 961, 961, 1285, 961, 961, 1069, 961, 961,
-        961, 961, 961, 961, 961, 961, 961, 961, 961, 961,
-        961, 961, 961, 1069, 1015, 1015, 1339, 1339, 1339, 1339,
-        1339, 1339, - 1, 74, 124, 124, 124, 124, 124, 474,
-        424, 599, 649, 699, 324, 174, 224, 374, 274, 549,
-        749, 749, 749, 749, 749, 749, 749, 749, 749, 749,
-        749, 749, 749, 749, 749, 749, 749, 749, 749, 788,
-        788, 1, 1411, 19, 277, 253, 76, 885, 65, 154,
-        863, 154, 863, 253, 517, 253, 221, 353, 367, 873,
-        101, 70, 175, 115, 202, 142, 11, 192, 239, 242,
-        365, 414, 365, 401, 365, 229, 370, 365, 919, 389,
-        56, 367, 390, 365, 390, 365, 365, 367, 717, 414,
-        365, 393, 333, 56, 365, 612, 301, 612, 301, 301,
-        301, 301, 301, 301, 301, 301, - 18, 169, 13, 270,
-        56, 56, 56, 56, 56, 56, 270, 56, 270, 56,
-        56, 56, 56, 270, 56, 321, 270, 56, 56, 56,
-        56, 56, 56, 296, 56, 270, 296, 270, 56, 301,
-        612, 628, 657, 301, 628, 612, 301, 657, 612, 494,
-        301, 371, 301, - 18, - 18, - 18, - 18, - 18, 1424, 1373,
-        1382, 1495, 146, 883, 217, 881, 223, 152, 0, 295,
-        - 17, 248, 148, 297, 294, 864, 320, 366, 544, 624,
-        567, 548, 566, 494, 492, 473, 475, 514, 540, 504,
-        518, 588, 530, 522, 491, 545, 603, 605, 570, 569,
-        489, 589, 583, 615, 415, 143, 470, 432, 478, 487,
-        467, 90,
-    );
-    const YY_REDUCE_USE_DFLT = - 111;
-    const YY_REDUCE_MAX = 207;
-    static public $yy_reduce_ofst = array(
-        - 30, 1319, 471, 1393, 1420, 1502, 1482, 1451, 1677, 1735,
-        1746, 1599, 1540, 1619, 1588, 2033, 2091, 1855, 1777, 1568,
-        1646, 1657, 1766, 1708, 1797, 1824, 1688, 2102, 1924, 1955,
-        1835, 2002, 2153, 2044, 1513, 2013, 2064, 2133, 2122, 1975,
-        1866, 1886, 1913, 1944, 899, 950, 1274, 1166, 1220, 1058,
-        1004, 1112, 466, 908, 854, 466, 1016, 976, 1070, 464,
-        464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
-        464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
-        464, 464, 464, 464, 464, 464, 464, 464, 464, 464,
-        464, - 26, 411, - 91, 187, 512, 718, 563, 613, 260,
-        513, 9, 462, - 14, 194, 261, - 15, - 56, 42, 354,
-        62, 316, 62, 614, 62, - 110, 200, 316, 316, - 110,
-        413, 345, 539, 387, 564, 62, 338, 289, 291, 289,
-        136, 362, 339, 340, 289, 665, 368, 364, - 110, 418,
-        565, 289, 62, 437, 664, - 4, 62, - 110, 62, 62,
-        62, 62, 62, 62, 212, 62, 62, 521, 543, 523,
-        533, 533, 533, 533, 533, 533, 523, 533, 523, 533,
-        533, 533, 533, 523, 533, 546, 523, 533, 533, 533,
-        533, 533, 533, 547, 533, 523, 571, 523, 533, 341,
-        590, 584, 537, 341, 585, 590, 341, 537, 590, 568,
-        341, 346, 341, 349, 394, 385, 381, 384,
-    );
-    static public $yyExpectedTokens = array(
-        array(4, 5, 6, 7, 8, 9, 10, 11, 14, 19, 20, 25, 29, 31,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 30, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 30, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 63, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 62, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(14, 15, 16, 19, 20, 25, 29, 31, 33, 35, 38, 53, 54, 55, 56, 57, 59, 61, 76,),
-        array(1, 3, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 24, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 26, 32, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 27, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 2, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 21, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,),
-        array(4, 5, 6, 7, 8, 9, 10, 11, 14, 19, 20, 25, 29, 31,),
-        array(1, 3, 18, 26, 32, 35, 58,),
-        array(15, 16, 59, 61,),
-        array(1, 3, 26, 32,),
-        array(1, 26, 32,),
-        array(7, 14, 19, 20, 25, 29, 31, 76, 77, 78,),
-        array(14, 16, 26, 28, 32,),
-        array(14, 16, 26, 28, 32,),
-        array(1, 3, 26, 32,),
-        array(14, 16, 26, 32,),
-        array(1, 3, 26, 32,),
-        array(14, 16, 26, 32,),
-        array(1, 26, 32,),
-        array(18, 56, 62,),
-        array(1, 26, 32,),
-        array(15, 16, 61,),
-        array(1, 2,),
-        array(15, 35,),
-        array(7, 14, 19, 20, 25, 29, 31, 76, 77, 78,),
-        array(1, 3, 26, 27, 32,),
-        array(14, 16, 17, 60,),
-        array(1, 3, 26, 32,),
-        array(14, 16, 17, 22,),
-        array(1, 3, 26, 32,),
-        array(17, 18, 58,),
-        array(11, 12, 13,),
-        array(14, 16, 60,),
-        array(14, 16, 17,),
-        array(17, 18, 58,),
-        array(14, 16,),
-        array(15, 16,),
-        array(14, 16,),
-        array(26, 32,),
-        array(14, 16,),
-        array(1, 28,),
-        array(14, 16,),
-        array(14, 16,),
-        array(1, 18,),
-        array(14, 16,),
-        array(26, 32,),
-        array(15, 35,),
-        array(14, 16,),
-        array(14, 16,),
-        array(14, 16,),
-        array(14, 16,),
-        array(14, 16,),
-        array(15, 35,),
-        array(18, 58,),
-        array(15, 16,),
-        array(14, 16,),
-        array(14, 16,),
-        array(1, 3,),
-        array(26, 32,),
-        array(14, 16,),
-        array(18,),
-        array(1,),
-        array(18,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(1,),
-        array(),
-        array(14, 16, 60,),
-        array(14, 15, 16,),
-        array(56, 62,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(56, 62,),
-        array(26, 32,),
-        array(56, 62,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(56, 62,),
-        array(26, 32,),
-        array(14, 35,),
-        array(56, 62,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(26, 32,),
-        array(56, 62,),
-        array(26, 32,),
-        array(56, 62,),
-        array(56, 62,),
-        array(56, 62,),
-        array(26, 32,),
-        array(1,),
-        array(18,),
-        array(26,),
-        array(2,),
-        array(1,),
-        array(26,),
-        array(18,),
-        array(1,),
-        array(2,),
-        array(18,),
-        array(35,),
-        array(1,),
-        array(12,),
-        array(1,),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(3, 21, 23, 24, 26, 27, 32, 34, 35, 36, 58, 63, 77,),
-        array(3, 17, 26, 32, 35, 58,),
-        array(3, 22, 35, 51, 58,),
-        array(22, 35, 51, 58, 77,),
-        array(35, 56, 58, 63,),
-        array(22, 35, 51, 58,),
-        array(14, 15, 16, 33,),
-        array(22, 35, 58,),
-        array(28, 35, 58,),
-        array(35, 58,),
-        array(16, 60,),
-        array(35, 58,),
-        array(34, 36,),
-        array(35, 58,),
-        array(34, 36,),
-        array(34, 36,),
-        array(34, 63,),
-        array(2, 17,),
-        array(17, 56,),
-        array(21, 34,),
-        array(63,),
-        array(3,),
-        array(61,),
-        array(61,),
-        array(16,),
-        array(35,),
-        array(16,),
-        array(33,),
-        array(56,),
-        array(16,),
-        array(17,),
-        array(33,),
-        array(16,),
-        array(16,),
-        array(2,),
-        array(36,),
-        array(16,),
-        array(15,),
-        array(7,),
-        array(3,),
-        array(15,),
-        array(15,),
-        array(16,),
-        array(16,),
-        array(23,),
-        array(16,),
-        array(16,),
-        array(15,),
-        array(15,),
-        array(52,),
-        array(3,),
-        array(16,),
-        array(35,),
-        array(2,),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-        array(),
-    );
-    static public $yy_default = array(
-        364, 545, 562, 516, 562, 562, 516, 516, 562, 562,
-        562, 562, 562, 562, 562, 562, 562, 562, 562, 562,
-        562, 562, 562, 562, 562, 562, 562, 562, 562, 562,
-        562, 562, 562, 562, 562, 562, 562, 562, 562, 562,
-        562, 562, 562, 562, 562, 562, 562, 562, 562, 562,
-        562, 562, 562, 419, 419, 419, 388, 396, 419, 562,
-        562, 424, 562, 562, 562, 562, 562, 562, 562, 562,
-        452, 515, 429, 548, 424, 453, 443, 444, 426, 448,
-        421, 449, 445, 547, 440, 401, 546, 514, 430, 456,
-        455, 361, 467, 562, 432, 419, 562, 419, 419, 474,
-        419, 439, 419, 419, 528, 419, 562, 410, 562, 562,
-        432, 489, 432, 562, 432, 480, 562, 489, 489, 480,
-        562, 562, 562, 419, 562, 432, 562, 562, 413, 562,
-        419, 562, 562, 562, 562, 562, 489, 562, 480, 562,
-        562, 562, 432, 398, 562, 525, 442, 480, 435, 437,
-        459, 436, 432, 458, 415, 460, 523, 490, 562, 508,
-        384, 385, 400, 406, 395, 409, 509, 391, 507, 386,
-        407, 399, 405, 487, 397, 489, 506, 389, 403, 390,
-        404, 383, 394, 485, 408, 486, 483, 484, 393, 414,
-        529, 561, 517, 411, 561, 526, 416, 518, 503, 489,
-        439, 379, 474, 489, 489, 522, 522, 522, 434, 467,
-        457, 457, 467, 457, 562, 457, 467, 562, 562, 475,
-        562, 467, 562, 562, 562, 501, 463, 562, 562, 562,
-        562, 562, 562, 501, 562, 465, 463, 562, 562, 562,
-        562, 562, 501, 562, 562, 562, 370, 562, 562, 562,
-        562, 562, 427, 562, 562, 562, 562, 469, 562, 562,
-        527, 501, 512, 494, 511, 498, 431, 496, 362, 502,
-        420, 428, 402, 510, 497, 469, 524, 560, 495, 531,
-        464, 466, 468, 433, 462, 461, 521, 519, 520, 434,
-        481, 470, 471, 472, 493, 492, 488, 491, 499, 501,
-        500, 369, 372, 371, 368, 367, 363, 365, 366, 373,
-        374, 381, 417, 418, 380, 378, 375, 376, 377, 473,
-        476, 412, 556, 549, 550, 504, 557, 477, 478, 479,
-        551, 554, 542, 544, 543, 552, 559, 553, 555, 558,
-        454, 438, 450, 451, 530, 447, 446, 441, 482, 505,
-        532, 533, 539, 540, 541, 538, 537, 534, 535, 536,
-        513,
-    );
-    const YYNOCODE = 124;
+
+    const TP_INSTANCEOF = 41;
+
+    const TP_QMARK = 42;
+
+    const TP_NOT = 43;
+
+    const TP_TYPECAST = 44;
+
+    const TP_HEX = 45;
+
+    const TP_DOT = 46;
+
+    const TP_SINGLEQUOTESTRING = 47;
+
+    const TP_DOUBLECOLON = 48;
+
+    const TP_NAMESPACE = 49;
+
+    const TP_AT = 50;
+
+    const TP_HATCH = 51;
+
+    const TP_OPENB = 52;
+
+    const TP_CLOSEB = 53;
+
+    const TP_DOLLAR = 54;
+
+    const TP_LOGOP = 55;
+
+    const TP_TLOGOP = 56;
+
+    const TP_SINGLECOND = 57;
+
+    const TP_QUOTE = 58;
+
+    const TP_BACKTICK = 59;
+
+    const YY_NO_ACTION = 533;
+
+    const YY_ACCEPT_ACTION = 532;
+
+    const YY_ERROR_ACTION = 531;
+
+    const YY_SZ_ACTTAB = 2133;
+
+    static public $yy_action = array(292, 9, 133, 449, 280, 70, 208, 2, 84, 268, 11, 97, 155, 113, 267, 449, 366, 224,
+        303, 264, 217, 279, 231, 26, 21, 172, 274, 42, 190, 304, 17, 43, 39, 269, 223, 298, 13, 209, 194, 81, 1, 143,
+        317, 90, 148, 105, 52, 292, 9, 132, 93, 280, 200, 279, 2, 84, 35, 325, 91, 156, 113, 218, 219, 207, 224, 105,
+        264, 217, 279, 205, 194, 21, 268, 11, 42, 262, 26, 267, 43, 39, 269, 223, 233, 17, 209, 194, 81, 1, 252, 317,
+        186, 141, 101, 52, 292, 9, 134, 192, 280, 213, 279, 2, 84, 35, 325, 208, 12, 113, 235, 101, 220, 224, 3, 264,
+        217, 361, 231, 194, 21, 218, 258, 42, 110, 105, 16, 43, 39, 269, 223, 298, 26, 209, 448, 81, 1, 7, 317, 17, 332,
+        110, 52, 292, 9, 134, 448, 280, 197, 118, 2, 84, 286, 287, 288, 227, 113, 27, 229, 305, 224, 316, 264, 217, 232,
+        231, 229, 21, 136, 120, 42, 241, 329, 102, 43, 39, 269, 223, 298, 243, 209, 137, 81, 1, 260, 317, 208, 10, 186,
+        52, 292, 9, 134, 101, 280, 199, 406, 2, 84, 85, 313, 35, 325, 113, 27, 81, 248, 224, 317, 264, 217, 406, 212,
+        25, 21, 194, 101, 42, 406, 317, 461, 43, 39, 269, 223, 298, 461, 209, 263, 81, 1, 318, 317, 92, 150, 22, 52,
+        292, 9, 135, 140, 280, 213, 279, 2, 84, 110, 163, 94, 159, 113, 183, 296, 294, 224, 448, 264, 217, 279, 231,
+        194, 21, 263, 191, 42, 309, 221, 448, 43, 39, 269, 223, 298, 316, 209, 194, 81, 1, 229, 317, 317, 163, 185, 52,
+        292, 9, 131, 153, 280, 213, 194, 2, 84, 330, 268, 11, 279, 113, 24, 267, 221, 224, 30, 264, 217, 259, 231, 254,
+        5, 194, 265, 42, 302, 192, 83, 43, 39, 269, 223, 298, 158, 209, 208, 81, 1, 6, 317, 4, 157, 279, 52, 292, 9,
+        136, 154, 280, 213, 279, 2, 84, 27, 101, 247, 279, 113, 310, 192, 26, 224, 324, 264, 217, 170, 231, 17, 31, 121,
+        180, 42, 139, 192, 279, 43, 39, 269, 223, 298, 162, 209, 137, 81, 1, 179, 317, 266, 10, 279, 52, 292, 9, 134,
+        95, 280, 202, 194, 2, 84, 263, 266, 218, 222, 113, 146, 105, 266, 224, 208, 264, 217, 317, 231, 19, 21, 208, 32,
+        42, 163, 178, 17, 43, 39, 269, 223, 298, 160, 209, 279, 81, 1, 107, 317, 184, 304, 279, 52, 292, 9, 134, 266,
+        280, 213, 182, 2, 84, 230, 461, 336, 242, 113, 181, 192, 461, 224, 208, 264, 217, 145, 198, 319, 21, 189, 304,
+        42, 124, 149, 279, 43, 39, 269, 223, 298, 322, 209, 279, 81, 1, 194, 317, 121, 208, 34, 52, 292, 9, 136, 266,
+        280, 213, 138, 2, 84, 208, 37, 265, 152, 113, 236, 295, 37, 224, 297, 264, 217, 279, 231, 175, 31, 276, 261, 42,
+        249, 187, 251, 43, 39, 269, 223, 298, 193, 209, 192, 81, 477, 477, 317, 404, 275, 477, 52, 234, 114, 270, 285,
+        281, 282, 283, 289, 183, 12, 208, 404, 292, 9, 33, 331, 280, 284, 404, 2, 84, 448, 271, 250, 173, 113, 166, 98,
+        246, 224, 111, 264, 217, 448, 20, 323, 221, 6, 477, 477, 229, 214, 291, 477, 115, 69, 109, 40, 41, 38, 102, 268,
+        11, 278, 335, 168, 267, 211, 277, 299, 144, 260, 188, 263, 327, 328, 334, 293, 323, 279, 169, 206, 312, 229,
+        214, 87, 477, 115, 69, 109, 266, 266, 108, 102, 165, 208, 278, 335, 119, 226, 211, 277, 299, 88, 260, 406, 89,
+        323, 274, 86, 290, 300, 229, 214, 333, 311, 128, 59, 106, 222, 406, 151, 102, 171, 164, 278, 335, 406, 96, 211,
+        277, 299, 323, 260, 300, 186, 174, 229, 214, 268, 11, 128, 65, 109, 267, 279, 300, 102, 35, 325, 278, 335, 300,
+        26, 211, 277, 299, 300, 260, 300, 17, 323, 194, 300, 300, 216, 229, 214, 300, 300, 128, 65, 109, 300, 300, 300,
+        102, 300, 208, 278, 335, 448, 300, 211, 277, 299, 300, 260, 400, 300, 323, 240, 300, 448, 215, 229, 214, 208,
+        253, 128, 49, 106, 112, 26, 300, 102, 300, 403, 278, 335, 17, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229,
+        214, 403, 300, 128, 65, 109, 300, 300, 403, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300,
+        300, 323, 300, 300, 300, 210, 229, 214, 300, 300, 128, 59, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300,
+        300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 64, 109, 300, 300,
+        300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 128, 74,
+        109, 300, 36, 239, 102, 300, 176, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300,
+        300, 229, 78, 300, 300, 82, 44, 104, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 317, 260,
+        300, 300, 323, 300, 300, 300, 300, 229, 80, 300, 300, 82, 47, 104, 300, 300, 300, 102, 300, 300, 278, 335, 300,
+        300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 99, 54, 109, 300, 300, 300, 102, 300, 300, 278,
+        335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 61, 109,
+        300, 300, 300, 102, 300, 300, 278, 335, 314, 300, 211, 277, 299, 300, 260, 300, 292, 8, 315, 300, 280, 300, 300,
+        2, 84, 300, 18, 201, 300, 113, 272, 300, 300, 224, 323, 264, 217, 300, 300, 229, 214, 300, 300, 128, 66, 109,
+        300, 273, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 301, 23, 229, 214, 300, 317,
+        128, 72, 109, 300, 300, 300, 102, 300, 300, 278, 335, 314, 300, 211, 277, 299, 300, 260, 300, 292, 8, 315, 300,
+        280, 300, 300, 2, 84, 300, 300, 300, 300, 113, 300, 300, 300, 224, 323, 264, 217, 300, 300, 229, 214, 300, 300,
+        128, 63, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 300, 23, 229, 214,
+        300, 300, 128, 45, 109, 300, 300, 300, 102, 268, 11, 278, 335, 300, 267, 211, 277, 299, 300, 260, 300, 300, 323,
+        26, 300, 147, 300, 229, 204, 300, 17, 117, 53, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277,
+        299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 75, 109, 300, 300, 300, 102, 300,
+        300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 128, 56, 109, 300, 300,
+        300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214,
+        300, 300, 116, 50, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300,
+        323, 300, 300, 300, 300, 229, 214, 300, 300, 103, 67, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300,
+        211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 128, 46, 109, 300, 300, 300, 102, 300, 300, 278,
+        335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 76, 109,
+        300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300,
+        229, 214, 300, 300, 128, 73, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260,
+        300, 300, 300, 229, 214, 300, 300, 128, 77, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277,
+        299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 79, 109, 300, 300, 300, 102, 300,
+        300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128,
+        58, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 203,
+        300, 300, 128, 55, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300,
+        323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 62, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300,
+        211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 60, 109, 300, 300, 300,
+        102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 128, 71, 109,
+        300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260, 300, 300, 323, 300, 300, 300, 300,
+        229, 214, 300, 300, 128, 57, 109, 300, 300, 300, 102, 300, 300, 278, 335, 300, 300, 211, 277, 299, 300, 260,
+        300, 300, 323, 300, 300, 300, 300, 229, 214, 300, 300, 128, 48, 109, 300, 300, 300, 102, 300, 300, 278, 335,
+        300, 300, 211, 277, 299, 323, 260, 300, 300, 300, 229, 214, 300, 300, 100, 68, 109, 300, 300, 300, 102, 300,
+        300, 278, 335, 300, 410, 211, 277, 299, 300, 260, 300, 300, 323, 300, 410, 300, 410, 229, 237, 410, 300, 122,
+        300, 109, 300, 300, 410, 102, 410, 300, 410, 326, 300, 300, 211, 277, 299, 300, 260, 221, 300, 323, 300, 208,
+        300, 300, 229, 237, 416, 416, 130, 300, 109, 300, 300, 300, 102, 300, 300, 300, 255, 300, 300, 211, 277, 299,
+        29, 260, 26, 532, 51, 244, 287, 288, 227, 17, 300, 229, 225, 300, 40, 41, 38, 448, 300, 416, 416, 416, 477, 477,
+        225, 15, 300, 477, 461, 448, 300, 327, 328, 334, 477, 477, 416, 416, 416, 477, 461, 208, 300, 300, 300, 300, 40,
+        41, 38, 300, 300, 307, 300, 300, 300, 300, 461, 300, 461, 300, 477, 300, 461, 327, 328, 334, 26, 300, 461, 300,
+        461, 225, 477, 17, 461, 320, 300, 300, 40, 41, 38, 477, 477, 300, 32, 300, 477, 461, 300, 300, 300, 300, 300,
+        300, 300, 327, 328, 334, 300, 300, 300, 323, 300, 300, 300, 300, 229, 237, 300, 300, 127, 300, 109, 300, 300,
+        461, 102, 461, 300, 477, 300, 461, 300, 211, 277, 299, 300, 260, 14, 300, 300, 323, 300, 300, 300, 300, 229,
+        237, 477, 477, 126, 300, 109, 477, 461, 300, 102, 300, 300, 300, 300, 300, 300, 211, 277, 299, 300, 260, 300,
+        300, 323, 300, 300, 300, 300, 229, 237, 300, 300, 123, 300, 109, 461, 300, 461, 102, 477, 300, 461, 300, 300,
+        300, 211, 277, 299, 300, 260, 300, 323, 300, 300, 300, 300, 229, 237, 300, 300, 129, 300, 109, 300, 300, 300,
+        102, 300, 300, 300, 300, 300, 300, 211, 277, 299, 208, 260, 225, 300, 208, 323, 300, 300, 300, 300, 229, 237,
+        477, 477, 125, 300, 109, 477, 461, 300, 102, 300, 300, 300, 300, 26, 300, 211, 277, 299, 300, 260, 17, 300, 208,
+        300, 300, 40, 41, 38, 256, 40, 41, 38, 245, 208, 461, 300, 461, 300, 477, 300, 461, 300, 327, 328, 334, 208,
+        327, 328, 334, 300, 300, 300, 300, 300, 300, 257, 300, 208, 300, 40, 41, 38, 300, 300, 300, 300, 300, 195, 300,
+        228, 40, 41, 38, 300, 300, 300, 327, 328, 334, 300, 208, 300, 40, 41, 38, 208, 28, 327, 328, 334, 196, 208, 300,
+        300, 40, 41, 38, 300, 300, 327, 328, 334, 300, 300, 300, 300, 300, 300, 300, 300, 300, 327, 328, 334, 300, 300,
+        300, 40, 41, 38, 208, 300, 40, 41, 38, 208, 300, 300, 40, 41, 38, 300, 477, 477, 327, 328, 334, 477, 461, 327,
+        328, 334, 300, 321, 300, 327, 328, 334, 208, 300, 300, 167, 300, 300, 300, 300, 300, 40, 41, 38, 300, 300, 40,
+        41, 38, 300, 461, 300, 461, 300, 477, 300, 461, 300, 327, 328, 334, 300, 308, 327, 328, 334, 208, 300, 208, 40,
+        41, 38, 300, 300, 300, 300, 372, 300, 358, 300, 300, 300, 300, 238, 300, 300, 327, 328, 334, 263, 300, 26, 300,
+        26, 300, 300, 186, 177, 17, 300, 17, 448, 300, 300, 186, 161, 279, 300, 163, 35, 325, 208, 300, 448, 279, 186,
+        142, 35, 325, 300, 300, 306, 300, 194, 300, 279, 300, 300, 35, 325, 300, 194, 263, 300, 300, 300, 26, 300, 300,
+        300, 300, 300, 194, 17, 300, 300, 300, 300, 300, 300, 300, 163,);
+
+    static public $yy_lookahead = array(12, 13, 14, 36, 16, 17, 1, 19, 20, 12, 13, 71, 72, 25, 17, 48, 11, 29, 30, 31,
+        32, 81, 34, 26, 36, 28, 92, 39, 94, 95, 33, 43, 44, 45, 46, 47, 21, 49, 98, 51, 52, 75, 54, 71, 72, 79, 58, 12,
+        13, 14, 35, 16, 17, 81, 19, 20, 84, 85, 71, 72, 25, 75, 76, 77, 29, 79, 31, 32, 81, 34, 98, 36, 12, 13, 39, 17,
+        26, 17, 43, 44, 45, 46, 47, 33, 49, 98, 51, 52, 53, 54, 71, 72, 18, 58, 12, 13, 14, 98, 16, 17, 81, 19, 20, 84,
+        85, 1, 15, 25, 50, 18, 50, 29, 36, 31, 32, 11, 34, 98, 36, 75, 76, 39, 48, 79, 28, 43, 44, 45, 46, 47, 26, 49,
+        36, 51, 52, 36, 54, 33, 17, 48, 58, 12, 13, 14, 48, 16, 17, 48, 19, 20, 63, 64, 65, 66, 25, 35, 69, 37, 29, 64,
+        31, 32, 70, 34, 69, 36, 14, 75, 39, 17, 49, 79, 43, 44, 45, 46, 47, 14, 49, 46, 51, 52, 90, 54, 1, 52, 71, 58,
+        12, 13, 14, 18, 16, 17, 11, 19, 20, 102, 103, 84, 85, 25, 35, 51, 37, 29, 54, 31, 32, 26, 34, 15, 36, 98, 18,
+        39, 33, 54, 46, 43, 44, 45, 46, 47, 52, 49, 22, 51, 52, 95, 54, 71, 72, 15, 58, 12, 13, 14, 14, 16, 17, 81, 19,
+        20, 48, 41, 71, 72, 25, 8, 9, 10, 29, 36, 31, 32, 81, 34, 98, 36, 22, 71, 39, 59, 46, 48, 43, 44, 45, 46, 47,
+        64, 49, 98, 51, 52, 69, 54, 54, 41, 71, 58, 12, 13, 14, 72, 16, 17, 98, 19, 20, 53, 12, 13, 81, 25, 15, 17, 46,
+        29, 13, 31, 32, 22, 34, 53, 36, 98, 99, 39, 103, 98, 17, 43, 44, 45, 46, 47, 72, 49, 1, 51, 52, 36, 54, 35, 72,
+        81, 58, 12, 13, 14, 72, 16, 17, 81, 19, 20, 35, 18, 37, 81, 25, 53, 98, 26, 29, 89, 31, 32, 72, 34, 33, 36, 96,
+        71, 39, 14, 98, 81, 43, 44, 45, 46, 47, 72, 49, 46, 51, 52, 91, 54, 93, 52, 81, 58, 12, 13, 14, 36, 16, 17, 98,
+        19, 20, 22, 93, 75, 76, 25, 91, 79, 93, 29, 1, 31, 32, 54, 34, 26, 36, 1, 15, 39, 41, 72, 33, 43, 44, 45, 46,
+        47, 72, 49, 81, 51, 52, 79, 54, 94, 95, 81, 58, 12, 13, 14, 93, 16, 17, 14, 19, 20, 17, 46, 96, 17, 25, 71, 98,
+        52, 29, 1, 31, 32, 72, 34, 53, 36, 94, 95, 39, 17, 72, 81, 43, 44, 45, 46, 47, 89, 49, 81, 51, 52, 98, 54, 96,
+        1, 28, 58, 12, 13, 14, 93, 16, 17, 79, 19, 20, 1, 2, 99, 72, 25, 18, 65, 2, 29, 68, 31, 32, 81, 34, 51, 36, 34,
+        17, 39, 53, 80, 37, 43, 44, 45, 46, 47, 17, 49, 98, 51, 12, 13, 54, 11, 17, 17, 58, 15, 17, 34, 3, 4, 5, 6, 7,
+        8, 15, 1, 26, 12, 13, 23, 17, 16, 4, 33, 19, 20, 36, 17, 53, 51, 25, 91, 80, 17, 29, 21, 31, 32, 48, 42, 64, 46,
+        36, 12, 13, 69, 70, 11, 17, 73, 74, 75, 38, 39, 40, 79, 12, 13, 82, 83, 91, 17, 86, 87, 88, 72, 90, 80, 22, 55,
+        56, 57, 81, 64, 81, 91, 100, 101, 69, 70, 79, 50, 73, 74, 75, 93, 93, 67, 79, 91, 1, 82, 83, 78, 50, 86, 87, 88,
+        79, 90, 11, 79, 64, 92, 79, 9, 104, 69, 70, 86, 101, 73, 74, 75, 76, 26, 27, 79, 91, 91, 82, 83, 33, 91, 86, 87,
+        88, 64, 90, 104, 71, 72, 69, 70, 12, 13, 73, 74, 75, 17, 81, 104, 79, 84, 85, 82, 83, 104, 26, 86, 87, 88, 104,
+        90, 104, 33, 64, 98, 104, 104, 97, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 1, 82, 83, 36, 104, 86,
+        87, 88, 104, 90, 11, 104, 64, 46, 104, 48, 97, 69, 70, 1, 53, 73, 74, 75, 76, 26, 104, 79, 104, 11, 82, 83, 33,
+        104, 86, 87, 88, 64, 90, 104, 104, 104, 69, 70, 26, 104, 73, 74, 75, 104, 104, 33, 79, 104, 104, 82, 83, 104,
+        104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 97, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104,
+        104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104,
+        104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104,
+        13, 14, 79, 104, 17, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104,
+        73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 54, 90, 104, 104, 64, 104, 104, 104, 104,
+        69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104,
+        69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64,
+        104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 4, 104, 86, 87, 88, 104,
+        90, 104, 12, 13, 14, 104, 16, 104, 104, 19, 20, 104, 13, 14, 104, 25, 17, 104, 104, 29, 64, 31, 32, 104, 104,
+        69, 70, 104, 104, 73, 74, 75, 104, 34, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 58, 59, 69,
+        70, 104, 54, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 4, 104, 86, 87, 88, 104, 90, 104, 12, 13, 14, 104,
+        16, 104, 104, 19, 20, 104, 104, 104, 104, 25, 104, 104, 104, 29, 64, 31, 32, 104, 104, 69, 70, 104, 104, 73, 74,
+        75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 58, 59, 69, 70, 104, 104, 73, 74,
+        75, 104, 104, 104, 79, 12, 13, 82, 83, 104, 17, 86, 87, 88, 104, 90, 104, 104, 64, 26, 104, 28, 104, 69, 70,
+        104, 33, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104,
+        104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104,
+        104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104,
+        104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86,
+        87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104,
+        82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104,
+        82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104,
+        104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104,
+        73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104, 69, 70, 104, 104,
+        73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104,
+        104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104,
+        64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88,
+        64, 90, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88,
+        104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83,
+        104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104,
+        79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104, 69, 70, 104, 104, 73, 74, 75, 104, 104, 104,
+        79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 74,
+        75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69,
+        70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 64, 90, 104, 104, 104, 69,
+        70, 104, 104, 73, 74, 75, 104, 104, 104, 79, 104, 104, 82, 83, 104, 11, 86, 87, 88, 104, 90, 104, 104, 64, 104,
+        21, 104, 23, 69, 70, 26, 104, 73, 104, 75, 104, 104, 33, 79, 35, 104, 37, 83, 104, 104, 86, 87, 88, 104, 90, 46,
+        104, 64, 104, 1, 104, 104, 69, 70, 1, 2, 73, 104, 75, 104, 104, 104, 79, 104, 104, 104, 83, 104, 104, 86, 87,
+        88, 24, 90, 26, 61, 62, 63, 64, 65, 66, 33, 104, 69, 2, 104, 38, 39, 40, 36, 104, 38, 39, 40, 12, 13, 2, 15,
+        104, 17, 18, 48, 104, 55, 56, 57, 12, 13, 55, 56, 57, 17, 18, 1, 104, 104, 104, 104, 38, 39, 40, 104, 104, 11,
+        104, 104, 104, 104, 46, 104, 48, 104, 50, 104, 52, 55, 56, 57, 26, 104, 46, 104, 48, 2, 50, 33, 52, 53, 104,
+        104, 38, 39, 40, 12, 13, 104, 15, 104, 17, 18, 104, 104, 104, 104, 104, 104, 104, 55, 56, 57, 104, 104, 104, 64,
+        104, 104, 104, 104, 69, 70, 104, 104, 73, 104, 75, 104, 104, 46, 79, 48, 104, 50, 104, 52, 104, 86, 87, 88, 104,
+        90, 2, 104, 104, 64, 104, 104, 104, 104, 69, 70, 12, 13, 73, 104, 75, 17, 18, 104, 79, 104, 104, 104, 104, 104,
+        104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 104, 75, 46, 104, 48, 79, 50,
+        104, 52, 104, 104, 104, 86, 87, 88, 104, 90, 104, 64, 104, 104, 104, 104, 69, 70, 104, 104, 73, 104, 75, 104,
+        104, 104, 79, 104, 104, 104, 104, 104, 104, 86, 87, 88, 1, 90, 2, 104, 1, 64, 104, 104, 104, 104, 69, 70, 12,
+        13, 73, 104, 75, 17, 18, 104, 79, 104, 104, 104, 104, 26, 104, 86, 87, 88, 104, 90, 33, 104, 1, 104, 104, 38,
+        39, 40, 37, 38, 39, 40, 11, 1, 46, 104, 48, 104, 50, 104, 52, 104, 55, 56, 57, 1, 55, 56, 57, 104, 104, 104,
+        104, 104, 104, 11, 104, 1, 104, 38, 39, 40, 104, 104, 104, 104, 104, 11, 104, 37, 38, 39, 40, 104, 104, 104, 55,
+        56, 57, 104, 1, 104, 38, 39, 40, 1, 2, 55, 56, 57, 11, 1, 104, 104, 38, 39, 40, 104, 104, 55, 56, 57, 104, 104,
+        104, 104, 104, 104, 104, 104, 104, 55, 56, 57, 104, 104, 104, 38, 39, 40, 1, 104, 38, 39, 40, 1, 104, 104, 38,
+        39, 40, 104, 12, 13, 55, 56, 57, 17, 18, 55, 56, 57, 104, 53, 104, 55, 56, 57, 1, 104, 104, 27, 104, 104, 104,
+        104, 104, 38, 39, 40, 104, 104, 38, 39, 40, 104, 46, 104, 48, 104, 50, 104, 52, 104, 55, 56, 57, 104, 59, 55,
+        56, 57, 1, 104, 1, 38, 39, 40, 104, 104, 104, 104, 11, 104, 11, 104, 104, 104, 104, 18, 104, 104, 55, 56, 57,
+        22, 104, 26, 104, 26, 104, 104, 71, 72, 33, 104, 33, 36, 104, 104, 71, 72, 81, 104, 41, 84, 85, 1, 104, 48, 81,
+        71, 72, 84, 85, 104, 104, 11, 104, 98, 104, 81, 104, 104, 84, 85, 104, 98, 22, 104, 104, 104, 26, 104, 104, 104,
+        104, 104, 98, 33, 104, 104, 104, 104, 104, 104, 104, 41,);
+
+    const YY_SHIFT_USE_DFLT = - 34;
+
+    const YY_SHIFT_MAX = 242;
+
+    static public $yy_shift_ofst = array(517, 364, 270, 82, 364, 270, 82, 82, - 12, - 12, 35, 82, 82, 82, 129, 82, 82,
+        82, 82, 176, 223, 82, 82, 82, 82, 82, 176, 82, 82, 82, 82, 82, 411, 82, 82, 82, 82, 317, 317, 458, 458, 458,
+        458, 458, 1680, 1616, 1852, 1852, 1852, 1852, 1852, 517, 1004, 1955, 1989, 1984, 1909, 526, 1886, 1897, 1944,
+        1921, 1856, 1949, 2012, 2012, 2012, 2012, 2012, 2012, 2046, 2012, 2012, 2012, 2012, 2012, 2012, 1648, 2091,
+        1648, 2048, 152, 104, 319, 343, 933, - 3, 1063, 634, 634, 684, 684, 319, 343, 319, 343, 321, 319, 478, 601, 703,
+        805, 60, 183, 196, 280, 91, 280, 241, 74, 415, 224, 50, 373, 466, 440, 5, 393, 415, 50, 173, 173, 400, 400, 400,
+        400, 400, 400, 400, 400, - 34, 1709, 1662, 1650, 1853, 1766, 1985, 942, 556, 387, 498, 50, 50, 281, 50, 50, 133,
+        163, 50, 50, 50, 163, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 121, 133, 133, 133, 163, 133, 133, 50, 133,
+        163, 172, 50, 172, 287, 50, 50, 133, 400, 400, 76, 608, 173, 400, 400, 484, 484, 173, 173, 400, - 34, - 34,
+        - 34, - 34, - 34, 1621, 1567, 502, 652, 543, 96, 204, 238, 252, 290, 15, 58, - 33, 120, 99, 218, 217, 363, 167,
+        303, 501, 511, 508, 515, 485, 463, 461, 489, 497, 522, 530, 509, 548, 518, 507, 490, 487, 528, 479, 434, 558,
+        295, 76, 418, 442, 445,);
+
+    const YY_REDUCE_USE_DFLT = - 67;
+
+    const YY_REDUCE_MAX = 196;
+
+    static public $yy_reduce_ofst = array(1582, 488, 633, 658, 521, 550, 575, 604, 770, 799, 1024, 1302, 1410, 1439,
+        1244, 1107, 1190, 1493, 1078, 824, 970, 687, 924, 1327, 1219, 1161, 1136, 1053, 1273, 1468, 1385, 1356, 899,
+        995, 741, 716, 853, 1551, 1522, 1764, 1794, 1736, 1707, 1677, - 28, 571, 19, - 28, 2006, 2014, 2025, 87, 95,
+        115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 175, 115, 115, 115, 115,
+        115, 115, 115, 160, 115, 160, 92, - 13, - 60, - 14, 207, 333, 380, 505, 293, 246, 213, 260, 44, 410, 312, - 66,
+        340, 209, 190, 190, 338, 299, 190, 325, 299, 325, 279, 420, 325, 258, - 34, 278, 254, 366, 190, 190, 190, 370,
+        372, 325, 354, 190, 190, 284, 190, 190, 190, 190, 190, 190, 496, 496, 496, 496, 496, 496, 397, 504, 496, 496,
+        503, 503, 527, 503, 503, 523, 531, 503, 503, 503, 513, 503, 503, 503, 503, 503, 503, 503, 503, 503, 503, 503,
+        535, 523, 523, 523, 537, 523, 523, 503, 523, 534, 510, 503, 539, 540, 503, 503, 523, - 1, - 1, 544, 532, 134,
+        - 1, - 1, 382, 382, 134, 134, - 1, 499, 464, 419, 452, 481,);
+
+    static public $yyExpectedTokens = array(array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 53, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 52, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 54, 58,),
+        array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, 46, 47, 49, 51, 54, 58,),
+        array(1, 11, 26, 33, 38, 39, 40, 55, 56, 57,), array(1, 24, 26, 33, 38, 39, 40, 55, 56, 57,),
+        array(1, 26, 33, 38, 39, 40, 55, 56, 57,), array(1, 26, 33, 38, 39, 40, 55, 56, 57,),
+        array(1, 26, 33, 38, 39, 40, 55, 56, 57,), array(1, 26, 33, 38, 39, 40, 55, 56, 57,),
+        array(1, 26, 33, 38, 39, 40, 55, 56, 57,), array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,),
+        array(4, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), array(1, 38, 39, 40, 53, 55, 56, 57,),
+        array(1, 27, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57, 59,),
+        array(1, 11, 38, 39, 40, 55, 56, 57,), array(1, 21, 38, 39, 40, 55, 56, 57,),
+        array(1, 11, 38, 39, 40, 55, 56, 57,), array(1, 37, 38, 39, 40, 55, 56, 57,),
+        array(1, 11, 38, 39, 40, 55, 56, 57,), array(1, 11, 38, 39, 40, 55, 56, 57,),
+        array(1, 37, 38, 39, 40, 55, 56, 57,), array(1, 2, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,),
+        array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,),
+        array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), array(1, 11, 18, 26, 33, 36, 48,),
+        array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,),
+        array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,),
+        array(38, 39, 40, 55, 56, 57,), array(1, 11, 22, 26, 33, 41,), array(38, 39, 40, 55, 56, 57,),
+        array(1, 11, 22, 26, 33, 41,), array(14, 17, 51, 54,), array(1, 11, 26, 33,), array(1, 26, 33,),
+        array(14, 36, 54,), array(4, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), array(12, 13, 17, 26, 28, 33,),
+        array(12, 13, 17, 26, 28, 33,), array(12, 13, 17, 26, 33,), array(12, 13, 17, 26, 33,), array(1, 11, 26, 33,),
+        array(1, 11, 26, 33,), array(1, 26, 33,), array(14, 36, 54,), array(1, 26, 33,), array(14, 36, 54,),
+        array(18, 46, 52,), array(1, 26, 33,), array(1, 2,), array(1, 11, 26, 27, 33,), array(1, 11, 26, 33,),
+        array(13, 14, 17, 54,), array(12, 13, 17, 50,), array(1, 11, 26, 33,), array(15, 18, 48,), array(12, 13, 17,),
+        array(15, 18, 48,), array(12, 13, 17,), array(8, 9, 10,), array(18, 48,), array(14, 17,), array(14, 54,),
+        array(26, 33,), array(26, 33,), array(1, 18,), array(1, 28,), array(1, 11,), array(1, 53,), array(14, 17,),
+        array(26, 33,), array(18,), array(18,), array(1,), array(1,), array(1,), array(1,), array(1,), array(1,),
+        array(1,), array(1,), array(), array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,),
+        array(2, 12, 13, 17, 18, 46, 48, 50, 52, 53,), array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,),
+        array(2, 12, 13, 17, 18, 46, 48, 50, 52,), array(2, 12, 13, 17, 18, 46, 48, 50, 52,),
+        array(12, 13, 17, 18, 46, 48, 50, 52,), array(13, 14, 17, 34, 54,), array(12, 13, 17, 50,), array(15, 46, 52,),
+        array(12, 13, 17,), array(26, 33,), array(26, 33,), array(15, 22,), array(26, 33,), array(26, 33,),
+        array(46, 52,), array(14, 54,), array(26, 33,), array(26, 33,), array(26, 33,), array(14, 54,), array(26, 33,),
+        array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,), array(26, 33,),
+        array(26, 33,), array(26, 33,), array(26, 33,), array(17, 49,), array(46, 52,), array(46, 52,), array(46, 52,),
+        array(14, 54,), array(46, 52,), array(46, 52,), array(26, 33,), array(46, 52,), array(14, 54,), array(46, 52,),
+        array(26, 33,), array(46, 52,), array(13, 36,), array(26, 33,), array(26, 33,), array(46, 52,), array(1,),
+        array(1,), array(36,), array(9,), array(18,), array(1,), array(1,), array(2,), array(2,), array(18,),
+        array(18,), array(1,), array(), array(), array(), array(), array(),
+        array(1, 2, 36, 38, 39, 40, 48, 55, 56, 57,), array(11, 21, 23, 26, 33, 35, 37, 46,),
+        array(11, 15, 26, 33, 36, 48,), array(36, 46, 48, 53,), array(12, 13, 17, 50,), array(28, 36, 48,),
+        array(22, 41, 59,), array(22, 41, 53,), array(46, 53,), array(35, 53,), array(21, 35,), array(17, 50,),
+        array(36, 48,), array(35, 37,), array(36, 48,), array(15, 46,), array(36, 48,), array(22, 41,), array(35, 37,),
+        array(35, 37,), array(17,), array(15,), array(23,), array(17,), array(34,), array(37,), array(34,), array(17,),
+        array(17,), array(17,), array(4,), array(42,), array(11,), array(36,), array(46,), array(51,), array(53,),
+        array(17,), array(17,), array(17,), array(22,), array(17,), array(36,), array(17,), array(51,), array(53,),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),
+        array(), array(), array(), array(), array(), array(), array(), array(), array(), array(),);
+
+    static public $yy_default = array(340, 516, 531, 496, 531, 531, 496, 496, 531, 531, 531, 531, 531, 531, 531, 531,
+        531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
+        531, 531, 531, 531, 531, 531, 531, 400, 400, 400, 400, 376, 367, 337, 531, 531, 405, 531, 531, 531, 531, 531,
+        531, 531, 531, 531, 421, 495, 411, 405, 402, 519, 438, 412, 407, 381, 517, 494, 518, 426, 428, 427, 428, 531,
+        414, 400, 531, 531, 400, 400, 400, 400, 420, 445, 400, 531, 400, 531, 508, 400, 390, 414, 414, 531, 461, 414,
+        451, 461, 451, 461, 531, 451, 531, 531, 378, 400, 394, 414, 414, 414, 531, 400, 451, 505, 424, 418, 396, 417,
+        429, 430, 414, 431, 503, 450, 450, 450, 450, 450, 450, 531, 463, 477, 461, 369, 368, 531, 387, 380, 459, 531,
+        365, 386, 360, 531, 373, 362, 359, 374, 363, 385, 364, 371, 375, 377, 389, 531, 486, 457, 488, 531, 489, 458,
+        379, 455, 531, 456, 383, 454, 461, 384, 388, 487, 397, 395, 461, 353, 483, 391, 420, 498, 497, 506, 509, 445,
+        502, 502, 502, 461, 461, 438, 434, 438, 438, 462, 438, 428, 428, 434, 531, 531, 531, 446, 531, 531, 434, 438,
+        428, 531, 531, 531, 531, 408, 531, 436, 531, 531, 531, 531, 531, 344, 440, 531, 507, 434, 531, 441, 531, 531,
+        531, 428, 531, 477, 531, 531, 531, 477, 338, 482, 401, 492, 491, 469, 470, 413, 476, 468, 471, 504, 440, 467,
+        409, 382, 453, 499, 500, 432, 393, 501, 479, 480, 481, 433, 435, 464, 465, 466, 460, 416, 437, 439, 415, 399,
+        370, 345, 347, 348, 346, 343, 339, 341, 342, 349, 350, 356, 357, 398, 355, 354, 351, 352, 441, 442, 520, 521,
+        522, 392, 484, 493, 527, 528, 525, 524, 513, 515, 514, 523, 530, 526, 529, 478, 485, 474, 472, 475, 447, 444,
+        443, 422, 423, 510, 511, 449, 473, 452, 448, 425, 512, 419, 490,);
+
+    const YYNOCODE = 105;
+
     const YYSTACKDEPTH = 500;
     const YYSTACKDEPTH = 500;
-    const YYNSTATE = 361;
-    const YYNRULE = 201;
-    const YYERRORSYMBOL = 79;
+
+    const YYNSTATE = 337;
+
+    const YYNRULE = 194;
+
+    const YYERRORSYMBOL = 60;
+
     const YYERRSYMDT = 'yy0';
     const YYERRSYMDT = 'yy0';
+
     const YYFALLBACK = 0;
     const YYFALLBACK = 0;
+
     public static $yyFallback = array();
 
     public function Trace($TraceFILE, $zTracePrompt)
     public static $yyFallback = array();
 
     public function Trace($TraceFILE, $zTracePrompt)
@@ -1255,248 +739,98 @@ class Smarty_Internal_Templateparser
     }
 
     public $yyTraceFILE;
     }
 
     public $yyTraceFILE;
+
     public $yyTracePrompt;
     public $yyTracePrompt;
+
     public $yyidx;                    /* Index of top element in stack */
     public $yyerrcnt;                 /* Shifts left before out of the error */
     public $yystack = array();  /* The parser's stack */
 
     public $yyidx;                    /* Index of top element in stack */
     public $yyerrcnt;                 /* Shifts left before out of the error */
     public $yystack = array();  /* The parser's stack */
 
-    public $yyTokenName = array(
-        '$', 'VERT', 'COLON', 'RDEL',
-        'COMMENT', 'PHP', 'XMLTAG', 'TEXT',
-        'STRIPON', 'STRIPOFF', 'BLOCKSOURCE', 'LITERALSTART',
-        'LITERALEND', 'LITERAL', 'LDEL', 'DOLLAR',
-        'ID', 'EQUAL', 'PTR', 'LDELIF',
-        'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO',
-        'STEP', 'LDELFOREACH', 'SPACE', 'AS',
-        'APTR', 'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', 'LDELSLASH',
-        'ATTR', 'INTEGER', 'COMMA', 'OPENP',
-        'CLOSEP', 'MATH', 'UNIMATH', 'ANDSYM',
-        'ISIN', 'ISDIVBY', 'ISNOTDIVBY', 'ISEVEN',
-        'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY', 'ISODD',
-        'ISNOTODD', 'ISODDBY', 'ISNOTODDBY', 'INSTANCEOF',
-        'QMARK', 'NOT', 'TYPECAST', 'HEX',
-        'DOT', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE',
-        'AT', 'HATCH', 'OPENB', 'CLOSEB',
-        'EQUALS', 'NOTEQUALS', 'GREATERTHAN', 'LESSTHAN',
-        'GREATEREQUAL', 'LESSEQUAL', 'IDENTITY', 'NONEIDENTITY',
-        'MOD', 'LAND', 'LOR', 'LXOR',
-        'QUOTE', 'BACKTICK', 'DOLLARID', 'error',
-        'start', 'template', 'template_element', 'smartytag',
-        'literal', 'text_content', 'literal_elements', 'literal_element',
-        'value', 'modifierlist', 'attributes', 'expr',
-        'varindexed', 'statement', 'statements', 'optspace',
-        'varvar', 'foraction', 'modparameters', 'attribute',
-        'ternary', 'array', 'ifcond', 'lop',
-        'variable', 'ns1', 'function', 'doublequoted_with_quotes',
-        'static_class_access', 'object', 'arrayindex', 'indexdef',
-        'varvarele', 'objectchain', 'objectelement', 'method',
-        'params', 'modifier', 'modparameter', 'arrayelements',
-        'arrayelement', 'doublequoted', 'doublequotedcontent',
-    );
-
-    public static $yyRuleName = array(
-        "start ::= template",
-        "template ::= template_element",
-        "template ::= template template_element",
-        "template ::=",
-        "template_element ::= smartytag RDEL",
-        "template_element ::= COMMENT",
-        "template_element ::= literal",
-        "template_element ::= PHP",
-        "template_element ::= XMLTAG",
-        "template_element ::= text_content",
-        "text_content ::= TEXT",
-        "text_content ::= text_content TEXT",
-        "template_element ::= STRIPON",
-        "template_element ::= STRIPOFF",
-        "template_element ::= BLOCKSOURCE",
-        "literal ::= LITERALSTART LITERALEND",
-        "literal ::= LITERALSTART literal_elements LITERALEND",
-        "literal_elements ::= literal_elements literal_element",
-        "literal_elements ::=",
-        "literal_element ::= literal",
-        "literal_element ::= LITERAL",
-        "smartytag ::= LDEL value",
-        "smartytag ::= LDEL value modifierlist attributes",
-        "smartytag ::= LDEL value attributes",
-        "smartytag ::= LDEL expr modifierlist attributes",
-        "smartytag ::= LDEL expr attributes",
-        "smartytag ::= LDEL DOLLAR ID EQUAL value",
-        "smartytag ::= LDEL DOLLAR ID EQUAL expr",
-        "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes",
-        "smartytag ::= LDEL varindexed EQUAL expr attributes",
-        "smartytag ::= LDEL ID attributes",
-        "smartytag ::= LDEL ID",
-        "smartytag ::= LDEL ID modifierlist attributes",
-        "smartytag ::= LDEL ID PTR ID attributes",
-        "smartytag ::= LDEL ID PTR ID modifierlist attributes",
-        "smartytag ::= LDELIF expr",
-        "smartytag ::= LDELIF expr attributes",
-        "smartytag ::= LDELIF statement",
-        "smartytag ::= LDELIF statement attributes",
-        "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes",
-        "foraction ::= EQUAL expr",
-        "foraction ::= INCDEC",
-        "smartytag ::= LDELFOR statement TO expr attributes",
-        "smartytag ::= LDELFOR statement TO expr STEP expr attributes",
-        "smartytag ::= LDELFOREACH attributes",
-        "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes",
-        "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes",
-        "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes",
-        "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes",
-        "smartytag ::= LDELSETFILTER ID modparameters",
-        "smartytag ::= LDELSETFILTER ID modparameters modifierlist",
-        "smartytag ::= LDEL SMARTYBLOCKCHILDPARENT",
-        "smartytag ::= LDELSLASH ID",
-        "smartytag ::= LDELSLASH ID modifierlist",
-        "smartytag ::= LDELSLASH ID PTR ID",
-        "smartytag ::= LDELSLASH ID PTR ID modifierlist",
-        "attributes ::= attributes attribute",
-        "attributes ::= attribute",
-        "attributes ::=",
-        "attribute ::= SPACE ID EQUAL ID",
-        "attribute ::= ATTR expr",
-        "attribute ::= ATTR value",
-        "attribute ::= SPACE ID",
-        "attribute ::= SPACE expr",
-        "attribute ::= SPACE value",
-        "attribute ::= SPACE INTEGER EQUAL expr",
-        "statements ::= statement",
-        "statements ::= statements COMMA statement",
-        "statement ::= DOLLAR varvar EQUAL expr",
-        "statement ::= varindexed EQUAL expr",
-        "statement ::= OPENP statement CLOSEP",
-        "expr ::= value",
-        "expr ::= ternary",
-        "expr ::= DOLLAR ID COLON ID",
-        "expr ::= expr MATH value",
-        "expr ::= expr UNIMATH value",
-        "expr ::= expr ANDSYM value",
-        "expr ::= array",
-        "expr ::= expr modifierlist",
-        "expr ::= expr ifcond expr",
-        "expr ::= expr ISIN array",
-        "expr ::= expr ISIN value",
-        "expr ::= expr lop expr",
-        "expr ::= expr ISDIVBY expr",
-        "expr ::= expr ISNOTDIVBY expr",
-        "expr ::= expr ISEVEN",
-        "expr ::= expr ISNOTEVEN",
-        "expr ::= expr ISEVENBY expr",
-        "expr ::= expr ISNOTEVENBY expr",
-        "expr ::= expr ISODD",
-        "expr ::= expr ISNOTODD",
-        "expr ::= expr ISODDBY expr",
-        "expr ::= expr ISNOTODDBY expr",
-        "expr ::= variable INSTANCEOF ns1",
-        "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr",
-        "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",
-        "value ::= variable",
-        "value ::= UNIMATH value",
-        "value ::= NOT value",
-        "value ::= TYPECAST value",
-        "value ::= variable INCDEC",
-        "value ::= HEX",
-        "value ::= INTEGER",
-        "value ::= INTEGER DOT INTEGER",
-        "value ::= INTEGER DOT",
-        "value ::= DOT INTEGER",
-        "value ::= ID",
-        "value ::= function",
-        "value ::= OPENP expr CLOSEP",
-        "value ::= SINGLEQUOTESTRING",
-        "value ::= doublequoted_with_quotes",
-        "value ::= varindexed DOUBLECOLON static_class_access",
-        "value ::= smartytag RDEL",
-        "value ::= value modifierlist",
-        "value ::= NAMESPACE",
-        "value ::= ns1 DOUBLECOLON static_class_access",
-        "ns1 ::= ID",
-        "ns1 ::= NAMESPACE",
-        "ns1 ::= variable",
-        "variable ::= varindexed",
-        "variable ::= DOLLAR varvar AT ID",
-        "variable ::= object",
-        "variable ::= HATCH ID HATCH",
-        "variable ::= HATCH ID HATCH arrayindex",
-        "variable ::= HATCH variable HATCH",
-        "variable ::= HATCH variable HATCH arrayindex",
-        "varindexed ::= DOLLAR varvar arrayindex",
-        "arrayindex ::= arrayindex indexdef",
-        "arrayindex ::=",
-        "indexdef ::= DOT DOLLAR varvar",
-        "indexdef ::= DOT DOLLAR varvar AT ID",
-        "indexdef ::= DOT ID",
-        "indexdef ::= DOT INTEGER",
-        "indexdef ::= DOT LDEL expr RDEL",
-        "indexdef ::= OPENB ID CLOSEB",
-        "indexdef ::= OPENB ID DOT ID CLOSEB",
-        "indexdef ::= OPENB expr CLOSEB",
-        "indexdef ::= OPENB CLOSEB",
-        "varvar ::= varvarele",
-        "varvar ::= varvar varvarele",
-        "varvarele ::= ID",
-        "varvarele ::= LDEL expr RDEL",
-        "object ::= varindexed objectchain",
-        "objectchain ::= objectelement",
-        "objectchain ::= objectchain objectelement",
-        "objectelement ::= PTR ID arrayindex",
-        "objectelement ::= PTR DOLLAR varvar arrayindex",
-        "objectelement ::= PTR LDEL expr RDEL arrayindex",
-        "objectelement ::= PTR ID LDEL expr RDEL arrayindex",
-        "objectelement ::= PTR method",
-        "function ::= ns1 OPENP params CLOSEP",
-        "method ::= ID OPENP params CLOSEP",
-        "method ::= DOLLAR ID OPENP params CLOSEP",
-        "params ::= params COMMA expr",
-        "params ::= expr",
-        "params ::=",
-        "modifierlist ::= modifierlist modifier modparameters",
-        "modifierlist ::= modifier modparameters",
-        "modifier ::= VERT AT ID",
-        "modifier ::= VERT ID",
-        "modparameters ::= modparameters modparameter",
-        "modparameters ::=",
-        "modparameter ::= COLON value",
-        "modparameter ::= COLON array",
-        "static_class_access ::= method",
-        "static_class_access ::= method objectchain",
-        "static_class_access ::= ID",
-        "static_class_access ::= DOLLAR ID arrayindex",
-        "static_class_access ::= DOLLAR ID arrayindex objectchain",
-        "ifcond ::= EQUALS",
-        "ifcond ::= NOTEQUALS",
-        "ifcond ::= GREATERTHAN",
-        "ifcond ::= LESSTHAN",
-        "ifcond ::= GREATEREQUAL",
-        "ifcond ::= LESSEQUAL",
-        "ifcond ::= IDENTITY",
-        "ifcond ::= NONEIDENTITY",
-        "ifcond ::= MOD",
-        "lop ::= LAND",
-        "lop ::= LOR",
-        "lop ::= LXOR",
-        "array ::= OPENB arrayelements CLOSEB",
-        "arrayelements ::= arrayelement",
-        "arrayelements ::= arrayelements COMMA arrayelement",
-        "arrayelements ::=",
-        "arrayelement ::= value APTR expr",
-        "arrayelement ::= ID APTR expr",
-        "arrayelement ::= expr",
-        "doublequoted_with_quotes ::= QUOTE QUOTE",
-        "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE",
-        "doublequoted ::= doublequoted doublequotedcontent",
-        "doublequoted ::= doublequotedcontent",
-        "doublequotedcontent ::= BACKTICK variable BACKTICK",
-        "doublequotedcontent ::= BACKTICK expr BACKTICK",
-        "doublequotedcontent ::= DOLLARID",
-        "doublequotedcontent ::= LDEL variable RDEL",
-        "doublequotedcontent ::= LDEL expr RDEL",
-        "doublequotedcontent ::= smartytag RDEL",
-        "doublequotedcontent ::= TEXT",
-        "optspace ::= SPACE",
-        "optspace ::=",
-    );
+    public $yyTokenName = array('$', 'VERT', 'COLON', 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', 'BLOCKSOURCE',
+        'LITERALSTART', 'LITERALEND', 'LITERAL', 'RDEL', 'SIMPELOUTPUT', 'LDEL', 'DOLLARID', 'EQUAL', 'SIMPLETAG', 'ID',
+        'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', 'STEP', 'LDELFOREACH', 'SPACE', 'AS', 'APTR',
+        'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', 'OPENP',
+        'CLOSEP', 'MATH', 'UNIMATH', 'ISIN', 'INSTANCEOF', 'QMARK', 'NOT', 'TYPECAST', 'HEX', 'DOT',
+        'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', 'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP', 'TLOGOP',
+        'SINGLECOND', 'QUOTE', 'BACKTICK', 'error', 'start', 'template', 'template_element', 'smartytag', 'literal',
+        'text_content', 'literal_elements', 'literal_element', 'tag', 'variable', 'modifierlist', 'attributes', 'value',
+        'expr', 'varindexed', 'statement', 'statements', 'foraction', 'varvar', 'modparameters', 'attribute', 'ternary',
+        'array', 'lop', 'scond', 'ns1', 'function', 'doublequoted_with_quotes', 'static_class_access', 'object',
+        'arrayindex', 'indexdef', 'varvarele', 'objectchain', 'objectelement', 'method', 'params', 'modifier',
+        'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent',);
+
+    public static $yyRuleName = array('start ::= template', 'template ::= template_element',
+        'template ::= template template_element', 'template ::=', 'template_element ::= smartytag',
+        'template_element ::= literal', 'template_element ::= PHP', 'template_element ::= text_content',
+        'text_content ::= TEXT', 'text_content ::= text_content TEXT', 'template_element ::= STRIPON',
+        'template_element ::= STRIPOFF', 'template_element ::= BLOCKSOURCE', 'literal ::= LITERALSTART LITERALEND',
+        'literal ::= LITERALSTART literal_elements LITERALEND', 'literal_elements ::= literal_elements literal_element',
+        'literal_elements ::=', 'literal_element ::= literal', 'literal_element ::= LITERAL', 'smartytag ::= tag RDEL',
+        'smartytag ::= SIMPELOUTPUT', 'tag ::= LDEL variable', 'tag ::= LDEL variable modifierlist attributes',
+        'tag ::= LDEL variable attributes', 'tag ::= LDEL value', 'tag ::= LDEL value modifierlist attributes',
+        'tag ::= LDEL value attributes', 'tag ::= LDEL expr modifierlist attributes', 'tag ::= LDEL expr attributes',
+        'tag ::= LDEL DOLLARID EQUAL value', 'tag ::= LDEL DOLLARID EQUAL expr',
+        'tag ::= LDEL DOLLARID EQUAL expr attributes', 'tag ::= LDEL varindexed EQUAL expr attributes',
+        'smartytag ::= SIMPLETAG', 'tag ::= LDEL ID attributes', 'tag ::= LDEL ID',
+        'tag ::= LDEL ID modifierlist attributes', 'tag ::= LDEL ID PTR ID attributes',
+        'tag ::= LDEL ID PTR ID modifierlist attributes', 'tag ::= LDELIF expr', 'tag ::= LDELIF expr attributes',
+        'tag ::= LDELIF statement', 'tag ::= LDELIF statement attributes',
+        'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes',
+        'foraction ::= EQUAL expr', 'foraction ::= INCDEC', 'tag ::= LDELFOR statement TO expr attributes',
+        'tag ::= LDELFOR statement TO expr STEP expr attributes', 'tag ::= LDELFOREACH attributes',
+        'tag ::= LDELFOREACH SPACE value AS varvar attributes',
+        'tag ::= LDELFOREACH SPACE value AS varvar APTR varvar attributes',
+        'tag ::= LDELFOREACH SPACE expr AS varvar attributes',
+        'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', 'tag ::= LDELSETFILTER ID modparameters',
+        'tag ::= LDELSETFILTER ID modparameters modifierlist', 'tag ::= LDEL SMARTYBLOCKCHILDPARENT',
+        'smartytag ::= CLOSETAG', 'tag ::= LDELSLASH ID', 'tag ::= LDELSLASH ID modifierlist',
+        'tag ::= LDELSLASH ID PTR ID', 'tag ::= LDELSLASH ID PTR ID modifierlist',
+        'attributes ::= attributes attribute', 'attributes ::= attribute', 'attributes ::=',
+        'attribute ::= SPACE ID EQUAL ID', 'attribute ::= ATTR expr', 'attribute ::= ATTR value',
+        'attribute ::= SPACE ID', 'attribute ::= SPACE expr', 'attribute ::= SPACE value',
+        'attribute ::= SPACE INTEGER EQUAL expr', 'statements ::= statement',
+        'statements ::= statements COMMA statement', 'statement ::= DOLLARID EQUAL INTEGER',
+        'statement ::= DOLLARID EQUAL expr', 'statement ::= varindexed EQUAL expr',
+        'statement ::= OPENP statement CLOSEP', 'expr ::= value', 'expr ::= ternary', 'expr ::= DOLLARID COLON ID',
+        'expr ::= expr MATH value', 'expr ::= expr UNIMATH value', 'expr ::= array', 'expr ::= expr modifierlist',
+        'expr ::= expr lop expr', 'expr ::= expr scond', 'expr ::= expr ISIN array', 'expr ::= expr ISIN value',
+        'expr ::= variable INSTANCEOF ns1', 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr',
+        'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', 'value ::= variable', 'value ::= UNIMATH value',
+        'value ::= NOT value', 'value ::= TYPECAST value', 'value ::= variable INCDEC', 'value ::= HEX',
+        'value ::= INTEGER', 'value ::= INTEGER DOT INTEGER', 'value ::= INTEGER DOT', 'value ::= DOT INTEGER',
+        'value ::= ID', 'value ::= function', 'value ::= OPENP expr CLOSEP', 'value ::= SINGLEQUOTESTRING',
+        'value ::= doublequoted_with_quotes', 'value ::= varindexed DOUBLECOLON static_class_access',
+        'value ::= smartytag', 'value ::= value modifierlist', 'value ::= NAMESPACE',
+        'value ::= ns1 DOUBLECOLON static_class_access', 'ns1 ::= ID', 'ns1 ::= NAMESPACE', 'variable ::= DOLLARID',
+        'variable ::= varindexed', 'variable ::= varvar AT ID', 'variable ::= object', 'variable ::= HATCH ID HATCH',
+        'variable ::= HATCH ID HATCH arrayindex', 'variable ::= HATCH variable HATCH',
+        'variable ::= HATCH variable HATCH arrayindex', 'varindexed ::= DOLLARID arrayindex',
+        'varindexed ::= varvar arrayindex', 'arrayindex ::= arrayindex indexdef', 'arrayindex ::=',
+        'indexdef ::= DOT DOLLARID', 'indexdef ::= DOT varvar', 'indexdef ::= DOT varvar AT ID', 'indexdef ::= DOT ID',
+        'indexdef ::= DOT INTEGER', 'indexdef ::= DOT LDEL expr RDEL', 'indexdef ::= OPENB ID CLOSEB',
+        'indexdef ::= OPENB ID DOT ID CLOSEB', 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB',
+        'indexdef ::= OPENB INTEGER CLOSEB', 'indexdef ::= OPENB DOLLARID CLOSEB', 'indexdef ::= OPENB variable CLOSEB',
+        'indexdef ::= OPENB value CLOSEB', 'indexdef ::= OPENB expr CLOSEB', 'indexdef ::= OPENB CLOSEB',
+        'varvar ::= DOLLARID', 'varvar ::= DOLLAR', 'varvar ::= varvar varvarele', 'varvarele ::= ID',
+        'varvarele ::= SIMPELOUTPUT', 'varvarele ::= LDEL expr RDEL', 'object ::= varindexed objectchain',
+        'objectchain ::= objectelement', 'objectchain ::= objectchain objectelement',
+        'objectelement ::= PTR ID arrayindex', 'objectelement ::= PTR varvar arrayindex',
+        'objectelement ::= PTR LDEL expr RDEL arrayindex', 'objectelement ::= PTR ID LDEL expr RDEL arrayindex',
+        'objectelement ::= PTR method', 'function ::= ns1 OPENP params CLOSEP', 'method ::= ID OPENP params CLOSEP',
+        'method ::= DOLLARID OPENP params CLOSEP', 'params ::= params COMMA expr', 'params ::= expr', 'params ::=',
+        'modifierlist ::= modifierlist modifier modparameters', 'modifierlist ::= modifier modparameters',
+        'modifier ::= VERT AT ID', 'modifier ::= VERT ID', 'modparameters ::= modparameters modparameter',
+        'modparameters ::=', 'modparameter ::= COLON value', 'modparameter ::= COLON array',
+        'static_class_access ::= method', 'static_class_access ::= method objectchain', 'static_class_access ::= ID',
+        'static_class_access ::= DOLLARID arrayindex', 'static_class_access ::= DOLLARID arrayindex objectchain',
+        'lop ::= LOGOP', 'lop ::= TLOGOP', 'scond ::= SINGLECOND', 'array ::= OPENB arrayelements CLOSEB',
+        'arrayelements ::= arrayelement', 'arrayelements ::= arrayelements COMMA arrayelement', 'arrayelements ::=',
+        'arrayelement ::= value APTR expr', 'arrayelement ::= ID APTR expr', 'arrayelement ::= expr',
+        'doublequoted_with_quotes ::= QUOTE QUOTE', 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE',
+        'doublequoted ::= doublequoted doublequotedcontent', 'doublequoted ::= doublequotedcontent',
+        'doublequotedcontent ::= BACKTICK variable BACKTICK', 'doublequotedcontent ::= BACKTICK expr BACKTICK',
+        'doublequotedcontent ::= DOLLARID', 'doublequotedcontent ::= LDEL variable RDEL',
+        'doublequotedcontent ::= LDEL expr RDEL', 'doublequotedcontent ::= smartytag', 'doublequotedcontent ::= TEXT',);
 
     public function tokenName($tokenType)
     {
 
     public function tokenName($tokenType)
     {
@@ -1520,14 +854,12 @@ class Smarty_Internal_Templateparser
 
     public function yy_pop_parser_stack()
     {
 
     public function yy_pop_parser_stack()
     {
-        if (!count($this->yystack)) {
+        if (empty($this->yystack)) {
             return;
         }
         $yytos = array_pop($this->yystack);
         if ($this->yyTraceFILE && $this->yyidx >= 0) {
             return;
         }
         $yytos = array_pop($this->yystack);
         if ($this->yyTraceFILE && $this->yyidx >= 0) {
-            fwrite($this->yyTraceFILE,
-                   $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
-                   "\n");
+            fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . "\n");
         }
         $yymajor = $yytos->major;
         self::yy_destructor($yymajor, $yytos->minor);
         }
         $yymajor = $yytos->major;
         self::yy_destructor($yymajor, $yytos->minor);
@@ -1548,10 +880,18 @@ class Smarty_Internal_Templateparser
 
     public function yy_get_expected_tokens($token)
     {
 
     public function yy_get_expected_tokens($token)
     {
+        static $res3 = array();
+        static $res4 = array();
         $state = $this->yystack[$this->yyidx]->stateno;
         $expected = self::$yyExpectedTokens[$state];
         $state = $this->yystack[$this->yyidx]->stateno;
         $expected = self::$yyExpectedTokens[$state];
-        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
-            return $expected;
+        if (isset($res3[$state][$token])) {
+            if ($res3[$state][$token]) {
+                return $expected;
+            }
+        } else {
+            if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) {
+                return $expected;
+            }
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
@@ -1570,17 +910,21 @@ class Smarty_Internal_Templateparser
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
-                    $nextstate = $this->yy_find_reduce_action(
-                        $this->yystack[$this->yyidx]->stateno,
-                        self::$yyRuleInfo[$yyruleno][0]);
+                    $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]);
                     if (isset(self::$yyExpectedTokens[$nextstate])) {
                         $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
                     if (isset(self::$yyExpectedTokens[$nextstate])) {
                         $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
-                        if (in_array($token,
-                                     self::$yyExpectedTokens[$nextstate], true)) {
-                            $this->yyidx = $yyidx;
-                            $this->yystack = $stack;
-
-                            return array_unique($expected);
+                        if (isset($res4[$nextstate][$token])) {
+                            if ($res4[$nextstate][$token]) {
+                                $this->yyidx = $yyidx;
+                                $this->yystack = $stack;
+                                return array_unique($expected);
+                            }
+                        } else {
+                            if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
+                                $this->yyidx = $yyidx;
+                                $this->yystack = $stack;
+                                return array_unique($expected);
+                            }
                         }
                     }
                     if ($nextstate < self::YYNSTATE) {
                         }
                     }
                     if ($nextstate < self::YYNSTATE) {
@@ -1618,12 +962,20 @@ class Smarty_Internal_Templateparser
 
     public function yy_is_expected_token($token)
     {
 
     public function yy_is_expected_token($token)
     {
+        static $res = array();
+        static $res2 = array();
         if ($token === 0) {
             return true; // 0 is not part of this
         }
         $state = $this->yystack[$this->yyidx]->stateno;
         if ($token === 0) {
             return true; // 0 is not part of this
         }
         $state = $this->yystack[$this->yyidx]->stateno;
-        if (in_array($token, self::$yyExpectedTokens[$state], true)) {
-            return true;
+        if (isset($res[$state][$token])) {
+            if ($res[$state][$token]) {
+                return true;
+            }
+        } else {
+            if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) {
+                return true;
+            }
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
         }
         $stack = $this->yystack;
         $yyidx = $this->yyidx;
@@ -1642,16 +994,19 @@ class Smarty_Internal_Templateparser
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
                     }
                     $yyruleno = $yyact - self::YYNSTATE;
                     $this->yyidx -= self::$yyRuleInfo[$yyruleno][1];
-                    $nextstate = $this->yy_find_reduce_action(
-                        $this->yystack[$this->yyidx]->stateno,
-                        self::$yyRuleInfo[$yyruleno][0]);
-                    if (isset(self::$yyExpectedTokens[$nextstate]) &&
-                        in_array($token, self::$yyExpectedTokens[$nextstate], true)
-                    ) {
-                        $this->yyidx = $yyidx;
-                        $this->yystack = $stack;
-
-                        return true;
+                    $nextstate = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno][0]);
+                    if (isset($res2[$nextstate][$token])) {
+                        if ($res2[$nextstate][$token]) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return true;
+                        }
+                    } else {
+                        if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) {
+                            $this->yyidx = $yyidx;
+                            $this->yystack = $stack;
+                            return true;
+                        }
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
                     }
                     if ($nextstate < self::YYNSTATE) {
                         // we need to shift a non-terminal
@@ -1707,16 +1062,10 @@ class Smarty_Internal_Templateparser
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
-        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
-            self::$yy_lookahead[$i] != $iLookAhead
-        ) {
-            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
-                && ($iFallback = self::$yyFallback[$iLookAhead]) != 0
-            ) {
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) {
+            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
                 if ($this->yyTraceFILE) {
                 if ($this->yyTraceFILE) {
-                    fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " .
-                                             $this->yyTokenName[$iLookAhead] . " => " .
-                                             $this->yyTokenName[$iFallback] . "\n");
+                    fwrite($this->yyTraceFILE, $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[$iLookAhead] . " => " . $this->yyTokenName[$iFallback] . "\n");
                 }
 
                 return $this->yy_find_shift_action($iFallback);
                 }
 
                 return $this->yy_find_shift_action($iFallback);
@@ -1743,9 +1092,7 @@ class Smarty_Internal_Templateparser
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
             return self::YY_NO_ACTION;
         }
         $i += $iLookAhead;
-        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
-            self::$yy_lookahead[$i] != $iLookAhead
-        ) {
+        if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) {
             return self::$yy_default[$stateno];
         } else {
             return self::$yy_action[$i];
             return self::$yy_default[$stateno];
         } else {
             return self::$yy_action[$i];
@@ -1763,7 +1110,7 @@ class Smarty_Internal_Templateparser
             while ($this->yyidx >= 0) {
                 $this->yy_pop_parser_stack();
             }
             while ($this->yyidx >= 0) {
                 $this->yy_pop_parser_stack();
             }
-            #line 184 "../smarty/lexer/smarty_internal_templateparser.y"
+            #line 190 "../smarty/lexer/smarty_internal_templateparser.y"
 
             $this->internalError = true;
             $this->compiler->trigger_template_error("Stack overflow in template parser");
 
             $this->internalError = true;
             $this->compiler->trigger_template_error("Stack overflow in template parser");
@@ -1774,433 +1121,103 @@ class Smarty_Internal_Templateparser
         $yytos->stateno = $yyNewState;
         $yytos->major = $yyMajor;
         $yytos->minor = $yypMinor;
         $yytos->stateno = $yyNewState;
         $yytos->major = $yyMajor;
         $yytos->minor = $yypMinor;
-        array_push($this->yystack, $yytos);
+        $this->yystack[] = $yytos;
         if ($this->yyTraceFILE && $this->yyidx > 0) {
         if ($this->yyTraceFILE && $this->yyidx > 0) {
-            fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt,
-                    $yyNewState);
+            fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState);
             fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt);
             for ($i = 1; $i <= $this->yyidx; $i ++) {
             fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt);
             for ($i = 1; $i <= $this->yyidx; $i ++) {
-                fprintf($this->yyTraceFILE, " %s",
-                        $this->yyTokenName[$this->yystack[$i]->major]);
+                fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[$this->yystack[$i]->major]);
             }
             fwrite($this->yyTraceFILE, "\n");
         }
     }
 
             }
             fwrite($this->yyTraceFILE, "\n");
         }
     }
 
-    public static $yyRuleInfo = array(
-        array(0 => 80, 1 => 1),
-        array(0 => 81, 1 => 1),
-        array(0 => 81, 1 => 2),
-        array(0 => 81, 1 => 0),
-        array(0 => 82, 1 => 2),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 85, 1 => 1),
-        array(0 => 85, 1 => 2),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 82, 1 => 1),
-        array(0 => 84, 1 => 2),
-        array(0 => 84, 1 => 3),
-        array(0 => 86, 1 => 2),
-        array(0 => 86, 1 => 0),
-        array(0 => 87, 1 => 1),
-        array(0 => 87, 1 => 1),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 4),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 4),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 5),
-        array(0 => 83, 1 => 5),
-        array(0 => 83, 1 => 6),
-        array(0 => 83, 1 => 5),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 4),
-        array(0 => 83, 1 => 5),
-        array(0 => 83, 1 => 6),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 11),
-        array(0 => 97, 1 => 2),
-        array(0 => 97, 1 => 1),
-        array(0 => 83, 1 => 5),
-        array(0 => 83, 1 => 7),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 7),
-        array(0 => 83, 1 => 10),
-        array(0 => 83, 1 => 7),
-        array(0 => 83, 1 => 10),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 4),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 2),
-        array(0 => 83, 1 => 3),
-        array(0 => 83, 1 => 4),
-        array(0 => 83, 1 => 5),
-        array(0 => 90, 1 => 2),
-        array(0 => 90, 1 => 1),
-        array(0 => 90, 1 => 0),
-        array(0 => 99, 1 => 4),
-        array(0 => 99, 1 => 2),
-        array(0 => 99, 1 => 2),
-        array(0 => 99, 1 => 2),
-        array(0 => 99, 1 => 2),
-        array(0 => 99, 1 => 2),
-        array(0 => 99, 1 => 4),
-        array(0 => 94, 1 => 1),
-        array(0 => 94, 1 => 3),
-        array(0 => 93, 1 => 4),
-        array(0 => 93, 1 => 3),
-        array(0 => 93, 1 => 3),
-        array(0 => 91, 1 => 1),
-        array(0 => 91, 1 => 1),
-        array(0 => 91, 1 => 4),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 1),
-        array(0 => 91, 1 => 2),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 2),
-        array(0 => 91, 1 => 2),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 2),
-        array(0 => 91, 1 => 2),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 91, 1 => 3),
-        array(0 => 100, 1 => 8),
-        array(0 => 100, 1 => 7),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 3),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 3),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 3),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 2),
-        array(0 => 88, 1 => 1),
-        array(0 => 88, 1 => 3),
-        array(0 => 105, 1 => 1),
-        array(0 => 105, 1 => 1),
-        array(0 => 105, 1 => 1),
-        array(0 => 104, 1 => 1),
-        array(0 => 104, 1 => 4),
-        array(0 => 104, 1 => 1),
-        array(0 => 104, 1 => 3),
-        array(0 => 104, 1 => 4),
-        array(0 => 104, 1 => 3),
-        array(0 => 104, 1 => 4),
-        array(0 => 92, 1 => 3),
-        array(0 => 110, 1 => 2),
-        array(0 => 110, 1 => 0),
-        array(0 => 111, 1 => 3),
-        array(0 => 111, 1 => 5),
-        array(0 => 111, 1 => 2),
-        array(0 => 111, 1 => 2),
-        array(0 => 111, 1 => 4),
-        array(0 => 111, 1 => 3),
-        array(0 => 111, 1 => 5),
-        array(0 => 111, 1 => 3),
-        array(0 => 111, 1 => 2),
-        array(0 => 96, 1 => 1),
-        array(0 => 96, 1 => 2),
-        array(0 => 112, 1 => 1),
-        array(0 => 112, 1 => 3),
-        array(0 => 109, 1 => 2),
-        array(0 => 113, 1 => 1),
-        array(0 => 113, 1 => 2),
-        array(0 => 114, 1 => 3),
-        array(0 => 114, 1 => 4),
-        array(0 => 114, 1 => 5),
-        array(0 => 114, 1 => 6),
-        array(0 => 114, 1 => 2),
-        array(0 => 106, 1 => 4),
-        array(0 => 115, 1 => 4),
-        array(0 => 115, 1 => 5),
-        array(0 => 116, 1 => 3),
-        array(0 => 116, 1 => 1),
-        array(0 => 116, 1 => 0),
-        array(0 => 89, 1 => 3),
-        array(0 => 89, 1 => 2),
-        array(0 => 117, 1 => 3),
-        array(0 => 117, 1 => 2),
-        array(0 => 98, 1 => 2),
-        array(0 => 98, 1 => 0),
-        array(0 => 118, 1 => 2),
-        array(0 => 118, 1 => 2),
-        array(0 => 108, 1 => 1),
-        array(0 => 108, 1 => 2),
-        array(0 => 108, 1 => 1),
-        array(0 => 108, 1 => 3),
-        array(0 => 108, 1 => 4),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 102, 1 => 1),
-        array(0 => 103, 1 => 1),
-        array(0 => 103, 1 => 1),
-        array(0 => 103, 1 => 1),
-        array(0 => 101, 1 => 3),
-        array(0 => 119, 1 => 1),
-        array(0 => 119, 1 => 3),
-        array(0 => 119, 1 => 0),
-        array(0 => 120, 1 => 3),
-        array(0 => 120, 1 => 3),
-        array(0 => 120, 1 => 1),
-        array(0 => 107, 1 => 2),
-        array(0 => 107, 1 => 3),
-        array(0 => 121, 1 => 2),
-        array(0 => 121, 1 => 1),
-        array(0 => 122, 1 => 3),
-        array(0 => 122, 1 => 3),
-        array(0 => 122, 1 => 1),
-        array(0 => 122, 1 => 3),
-        array(0 => 122, 1 => 3),
-        array(0 => 122, 1 => 2),
-        array(0 => 122, 1 => 1),
-        array(0 => 95, 1 => 1),
-        array(0 => 95, 1 => 0),
-    );
-
-    public static $yyReduceMap = array(
-        0   => 0,
-        1   => 1,
-        2   => 2,
-        4   => 4,
-        5   => 5,
-        6   => 6,
-        7   => 7,
-        8   => 8,
-        9   => 9,
-        10  => 10,
-        19  => 10,
-        20  => 10,
-        41  => 10,
-        63  => 10,
-        64  => 10,
-        71  => 10,
-        72  => 10,
-        77  => 10,
-        96  => 10,
-        101 => 10,
-        102 => 10,
-        107 => 10,
-        109 => 10,
-        110 => 10,
-        114 => 10,
-        116 => 10,
-        117 => 10,
-        118 => 10,
-        121 => 10,
-        138 => 10,
-        182 => 10,
-        187 => 10,
-        199 => 10,
-        11  => 11,
-        12  => 12,
-        13  => 13,
-        14  => 14,
-        15  => 15,
-        18  => 15,
-        200 => 15,
-        16  => 16,
-        70  => 16,
-        17  => 17,
-        97  => 17,
-        99  => 17,
-        100 => 17,
-        127 => 17,
-        21  => 21,
-        22  => 22,
-        23  => 23,
-        25  => 23,
-        24  => 24,
-        26  => 26,
-        27  => 26,
-        28  => 28,
-        29  => 29,
-        30  => 30,
-        31  => 31,
-        32  => 32,
-        33  => 33,
-        34  => 34,
-        35  => 35,
-        36  => 36,
-        38  => 36,
-        37  => 37,
-        39  => 39,
-        40  => 40,
-        42  => 42,
-        43  => 43,
-        44  => 44,
-        45  => 45,
-        47  => 45,
-        46  => 46,
-        48  => 46,
-        49  => 49,
-        50  => 50,
-        51  => 51,
-        52  => 52,
-        53  => 53,
-        54  => 54,
-        55  => 55,
-        56  => 56,
-        57  => 57,
-        66  => 57,
-        154 => 57,
-        158 => 57,
-        162 => 57,
-        163 => 57,
-        58  => 58,
-        155 => 58,
-        161 => 58,
-        59  => 59,
-        60  => 60,
-        61  => 60,
-        62  => 62,
-        65  => 65,
-        67  => 67,
-        68  => 68,
-        69  => 68,
-        73  => 73,
-        74  => 74,
-        75  => 74,
-        76  => 74,
-        78  => 78,
-        113 => 78,
-        79  => 79,
-        82  => 79,
-        80  => 80,
-        81  => 81,
-        83  => 83,
-        84  => 84,
-        85  => 85,
-        90  => 85,
-        86  => 86,
-        89  => 86,
-        87  => 87,
-        92  => 87,
-        88  => 88,
-        91  => 88,
-        93  => 93,
-        94  => 94,
-        95  => 95,
-        98  => 98,
-        103 => 103,
-        104 => 104,
-        105 => 105,
-        106 => 106,
-        108 => 108,
-        111 => 111,
-        112 => 112,
-        115 => 115,
-        119 => 119,
-        120 => 120,
-        122 => 122,
-        123 => 123,
-        124 => 124,
-        125 => 125,
-        126 => 126,
-        128 => 128,
-        184 => 128,
-        129 => 129,
-        130 => 130,
-        131 => 131,
-        132 => 132,
-        133 => 133,
-        136 => 133,
-        134 => 134,
-        135 => 135,
-        137 => 137,
-        139 => 139,
-        140 => 140,
-        141 => 141,
-        142 => 142,
-        143 => 143,
-        144 => 144,
-        145 => 145,
-        146 => 146,
-        147 => 147,
-        148 => 148,
-        149 => 149,
-        150 => 150,
-        151 => 151,
-        152 => 152,
-        153 => 153,
-        156 => 156,
-        157 => 157,
-        159 => 159,
-        160 => 160,
-        164 => 164,
-        165 => 165,
-        166 => 166,
-        167 => 167,
-        168 => 168,
-        169 => 169,
-        170 => 170,
-        171 => 171,
-        172 => 172,
-        173 => 173,
-        174 => 174,
-        175 => 175,
-        176 => 176,
-        177 => 177,
-        178 => 178,
-        179 => 179,
-        180 => 180,
-        181 => 181,
-        183 => 183,
-        185 => 185,
-        186 => 186,
-        188 => 188,
-        189 => 189,
-        190 => 190,
-        191 => 191,
-        192 => 192,
-        193 => 192,
-        195 => 192,
-        194 => 194,
-        196 => 196,
-        197 => 197,
-        198 => 198,
-    );
-
-    #line 195 "../smarty/lexer/smarty_internal_templateparser.y"
+    public static $yyRuleInfo = array(array(0 => 61, 1 => 1), array(0 => 62, 1 => 1), array(0 => 62, 1 => 2),
+        array(0 => 62, 1 => 0), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1),
+        array(0 => 63, 1 => 1), array(0 => 66, 1 => 1), array(0 => 66, 1 => 2), array(0 => 63, 1 => 1),
+        array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), array(0 => 65, 1 => 2), array(0 => 65, 1 => 3),
+        array(0 => 67, 1 => 2), array(0 => 67, 1 => 0), array(0 => 68, 1 => 1), array(0 => 68, 1 => 1),
+        array(0 => 64, 1 => 2), array(0 => 64, 1 => 1), array(0 => 69, 1 => 2), array(0 => 69, 1 => 4),
+        array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), array(0 => 69, 1 => 4), array(0 => 69, 1 => 3),
+        array(0 => 69, 1 => 4), array(0 => 69, 1 => 3), array(0 => 69, 1 => 4), array(0 => 69, 1 => 4),
+        array(0 => 69, 1 => 5), array(0 => 69, 1 => 5), array(0 => 64, 1 => 1), array(0 => 69, 1 => 3),
+        array(0 => 69, 1 => 2), array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), array(0 => 69, 1 => 6),
+        array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3),
+        array(0 => 69, 1 => 8), array(0 => 78, 1 => 2), array(0 => 78, 1 => 1), array(0 => 69, 1 => 5),
+        array(0 => 69, 1 => 7), array(0 => 69, 1 => 2), array(0 => 69, 1 => 6), array(0 => 69, 1 => 8),
+        array(0 => 69, 1 => 6), array(0 => 69, 1 => 8), array(0 => 69, 1 => 3), array(0 => 69, 1 => 4),
+        array(0 => 69, 1 => 2), array(0 => 64, 1 => 1), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3),
+        array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), array(0 => 72, 1 => 2), array(0 => 72, 1 => 1),
+        array(0 => 72, 1 => 0), array(0 => 81, 1 => 4), array(0 => 81, 1 => 2), array(0 => 81, 1 => 2),
+        array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 4),
+        array(0 => 77, 1 => 1), array(0 => 77, 1 => 3), array(0 => 76, 1 => 3), array(0 => 76, 1 => 3),
+        array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), array(0 => 74, 1 => 1), array(0 => 74, 1 => 1),
+        array(0 => 74, 1 => 3), array(0 => 74, 1 => 3), array(0 => 74, 1 => 3), array(0 => 74, 1 => 1),
+        array(0 => 74, 1 => 2), array(0 => 74, 1 => 3), array(0 => 74, 1 => 2), array(0 => 74, 1 => 3),
+        array(0 => 74, 1 => 3), array(0 => 74, 1 => 3), array(0 => 82, 1 => 7), array(0 => 82, 1 => 7),
+        array(0 => 73, 1 => 1), array(0 => 73, 1 => 2), array(0 => 73, 1 => 2), array(0 => 73, 1 => 2),
+        array(0 => 73, 1 => 2), array(0 => 73, 1 => 1), array(0 => 73, 1 => 1), array(0 => 73, 1 => 3),
+        array(0 => 73, 1 => 2), array(0 => 73, 1 => 2), array(0 => 73, 1 => 1), array(0 => 73, 1 => 1),
+        array(0 => 73, 1 => 3), array(0 => 73, 1 => 1), array(0 => 73, 1 => 1), array(0 => 73, 1 => 3),
+        array(0 => 73, 1 => 1), array(0 => 73, 1 => 2), array(0 => 73, 1 => 1), array(0 => 73, 1 => 3),
+        array(0 => 86, 1 => 1), array(0 => 86, 1 => 1), array(0 => 70, 1 => 1), array(0 => 70, 1 => 1),
+        array(0 => 70, 1 => 3), array(0 => 70, 1 => 1), array(0 => 70, 1 => 3), array(0 => 70, 1 => 4),
+        array(0 => 70, 1 => 3), array(0 => 70, 1 => 4), array(0 => 75, 1 => 2), array(0 => 75, 1 => 2),
+        array(0 => 91, 1 => 2), array(0 => 91, 1 => 0), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2),
+        array(0 => 92, 1 => 4), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2), array(0 => 92, 1 => 4),
+        array(0 => 92, 1 => 3), array(0 => 92, 1 => 5), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3),
+        array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3),
+        array(0 => 92, 1 => 2), array(0 => 79, 1 => 1), array(0 => 79, 1 => 1), array(0 => 79, 1 => 2),
+        array(0 => 93, 1 => 1), array(0 => 93, 1 => 1), array(0 => 93, 1 => 3), array(0 => 90, 1 => 2),
+        array(0 => 94, 1 => 1), array(0 => 94, 1 => 2), array(0 => 95, 1 => 3), array(0 => 95, 1 => 3),
+        array(0 => 95, 1 => 5), array(0 => 95, 1 => 6), array(0 => 95, 1 => 2), array(0 => 87, 1 => 4),
+        array(0 => 96, 1 => 4), array(0 => 96, 1 => 4), array(0 => 97, 1 => 3), array(0 => 97, 1 => 1),
+        array(0 => 97, 1 => 0), array(0 => 71, 1 => 3), array(0 => 71, 1 => 2), array(0 => 98, 1 => 3),
+        array(0 => 98, 1 => 2), array(0 => 80, 1 => 2), array(0 => 80, 1 => 0), array(0 => 99, 1 => 2),
+        array(0 => 99, 1 => 2), array(0 => 89, 1 => 1), array(0 => 89, 1 => 2), array(0 => 89, 1 => 1),
+        array(0 => 89, 1 => 2), array(0 => 89, 1 => 3), array(0 => 84, 1 => 1), array(0 => 84, 1 => 1),
+        array(0 => 85, 1 => 1), array(0 => 83, 1 => 3), array(0 => 100, 1 => 1), array(0 => 100, 1 => 3),
+        array(0 => 100, 1 => 0), array(0 => 101, 1 => 3), array(0 => 101, 1 => 3), array(0 => 101, 1 => 1),
+        array(0 => 88, 1 => 2), array(0 => 88, 1 => 3), array(0 => 102, 1 => 2), array(0 => 102, 1 => 1),
+        array(0 => 103, 1 => 3), array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), array(0 => 103, 1 => 3),
+        array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), array(0 => 103, 1 => 1),);
+
+    public static $yyReduceMap = array(0   => 0, 1 => 1, 2 => 2, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 17 => 8,
+                                       18  => 8, 45 => 8, 68 => 8, 69 => 8, 77 => 8, 78 => 8, 82 => 8, 91 => 8, 96 => 8,
+                                       97  => 8, 102 => 8, 104 => 8, 105 => 8, 109 => 8, 111 => 8, 112 => 8, 116 => 8,
+                                       177 => 8, 182 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 16 => 13,
+                                       14  => 14, 76 => 14, 15 => 15, 92 => 15, 94 => 15, 95 => 15, 123 => 15, 19 => 19,
+                                       20  => 20, 21 => 21, 24 => 21, 22 => 22, 25 => 22, 23 => 23, 26 => 23, 28 => 23,
+                                       27  => 27, 29 => 29, 30 => 29, 31 => 31, 32 => 32, 33 => 33, 34 => 34, 35 => 35,
+                                       36  => 36, 37 => 37, 38 => 38, 39 => 39, 40 => 40, 42 => 40, 41 => 41, 43 => 43,
+                                       44  => 44, 46 => 46, 47 => 47, 48 => 48, 49 => 49, 51 => 49, 50 => 50, 52 => 50,
+                                       53  => 53, 54 => 54, 55 => 55, 56 => 56, 57 => 57, 58 => 58, 59 => 59, 60 => 60,
+                                       61  => 61, 62 => 62, 71 => 62, 158 => 62, 162 => 62, 166 => 62, 167 => 62,
+                                       63  => 63, 159 => 63, 165 => 63, 64 => 64, 65 => 65, 66 => 65, 67 => 67,
+                                       143 => 67, 70 => 70, 72 => 72, 73 => 73, 74 => 73, 75 => 75, 79 => 79, 80 => 80,
+                                       81  => 80, 83 => 83, 108 => 83, 84 => 84, 85 => 85, 86 => 86, 87 => 87, 88 => 88,
+                                       89  => 89, 90 => 90, 93 => 93, 98 => 98, 99 => 99, 100 => 100, 101 => 101,
+                                       103 => 103, 106 => 106, 107 => 107, 110 => 110, 113 => 113, 114 => 114,
+                                       115 => 115, 117 => 117, 118 => 118, 119 => 119, 120 => 120, 121 => 121,
+                                       122 => 122, 124 => 124, 179 => 124, 125 => 125, 126 => 126, 127 => 127,
+                                       128 => 128, 129 => 129, 130 => 130, 138 => 130, 131 => 131, 132 => 132,
+                                       133 => 133, 134 => 133, 136 => 133, 137 => 133, 135 => 135, 139 => 139,
+                                       140 => 140, 141 => 141, 183 => 141, 142 => 142, 144 => 144, 145 => 145,
+                                       146 => 146, 147 => 147, 148 => 148, 149 => 149, 150 => 150, 151 => 151,
+                                       152 => 152, 153 => 153, 154 => 154, 155 => 155, 156 => 156, 157 => 157,
+                                       160 => 160, 161 => 161, 163 => 163, 164 => 164, 168 => 168, 169 => 169,
+                                       170 => 170, 171 => 171, 172 => 172, 173 => 173, 174 => 174, 175 => 175,
+                                       176 => 176, 178 => 178, 180 => 180, 181 => 181, 184 => 184, 185 => 185,
+                                       186 => 186, 187 => 187, 188 => 187, 190 => 187, 189 => 189, 191 => 191,
+                                       192 => 192, 193 => 193,);
+
+    #line 201 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r0()
     {
         $this->_retvalue = $this->root_buffer->to_smarty_php();
     }
 
     function yy_r0()
     {
         $this->_retvalue = $this->root_buffer->to_smarty_php();
     }
 
-    #line 203 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 209 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r1()
     {
         if ($this->yystack[$this->yyidx + 0]->minor != null) {
     function yy_r1()
     {
         if ($this->yystack[$this->yyidx + 0]->minor != null) {
@@ -2208,7 +1225,7 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 210 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 216 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r2()
     {
         if ($this->yystack[$this->yyidx + 0]->minor != null) {
     function yy_r2()
     {
         if ($this->yystack[$this->yyidx + 0]->minor != null) {
@@ -2217,16 +1234,11 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 224 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 230 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r4()
     {
         if ($this->compiler->has_code) {
     function yy_r4()
     {
         if ($this->compiler->has_code) {
-            $tmp = '';
-            foreach ($this->compiler->prefix_code as $code) {
-                $tmp .= $code;
-            }
-            $this->compiler->prefix_code = array();
-            $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $this->yystack[$this->yyidx + - 1]->minor, true));
+            $this->_retvalue = $this->mergePrefixCode($this->yystack[$this->yyidx + 0]->minor);
         } else {
             $this->_retvalue = null;
         }
         } else {
             $this->_retvalue = null;
         }
@@ -2234,22 +1246,17 @@ class Smarty_Internal_Templateparser
         $this->block_nesting_level = count($this->compiler->_tag_stack);
     }
 
         $this->block_nesting_level = count($this->compiler->_tag_stack);
     }
 
-    #line 236 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r5()
-    {
-        $this->_retvalue = null;
-    }
-
     #line 241 "../smarty/lexer/smarty_internal_templateparser.y"
     #line 241 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r6()
+    function yy_r5()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor);
     }
 
     #line 245 "../smarty/lexer/smarty_internal_templateparser.y"
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Text($this, $this->yystack[$this->yyidx + 0]->minor);
     }
 
     #line 245 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r7()
+    function yy_r6()
     {
     {
-        $code = $this->compiler->compileTag('private_php', array(array('code' => $this->yystack[$this->yyidx + 0]->minor), array('type' => $this->lex->phpType)), array());
+        $code = $this->compiler->compileTag('private_php', array(array('code' => $this->yystack[$this->yyidx + 0]->minor),
+            array('type' => $this->lex->phpType)), array());
         if ($this->compiler->has_code && !empty($code)) {
             $tmp = '';
             foreach ($this->compiler->prefix_code as $code) {
         if ($this->compiler->has_code && !empty($code)) {
             $tmp = '';
             foreach ($this->compiler->prefix_code as $code) {
@@ -2262,48 +1269,38 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 258 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r8()
-    {
-        $this->compiler->tag_nocache = true;
-        $xml = $this->yystack[$this->yyidx + 0]->minor;
-        $save = $this->template->has_nocache_code;
-        $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode("<?php echo '{$xml}';?>", $this->compiler, true));
-        $this->template->has_nocache_code = $save;
-    }
-
-    #line 267 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r9()
+    #line 256 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r7()
     {
         $this->_retvalue = $this->compiler->processText($this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = $this->compiler->processText($this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 271 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r10()
+    #line 260 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r8()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 275 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r11()
+    #line 264 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r9()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 280 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r12()
+    #line 269 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r10()
     {
         $this->strip = true;
     }
 
     {
         $this->strip = true;
     }
 
-    #line 284 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r13()
+    #line 273 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r11()
     {
         $this->strip = false;
     }
 
     {
         $this->strip = false;
     }
 
-    #line 288 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r14()
+    #line 277 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r12()
     {
         if ($this->strip) {
             SMARTY_INTERNAL_COMPILE_BLOCK::blockSource($this->compiler, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
     {
         if ($this->strip) {
             SMARTY_INTERNAL_COMPILE_BLOCK::blockSource($this->compiler, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
@@ -2312,24 +1309,41 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 297 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r15()
+    #line 286 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r13()
     {
         $this->_retvalue = '';
     }
 
     {
         $this->_retvalue = '';
     }
 
-    #line 301 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r16()
+    #line 290 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r14()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
     }
 
-    #line 305 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r17()
+    #line 294 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r15()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
+    #line 310 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r19()
+    {
+        $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
+    }
+
+    #line 316 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r20()
+    {
+        $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), ' $');
+        if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) {
+            $this->_retvalue = $this->compiler->compileTag('private_print_expression', array('nocache'), array('value' => $this->compiler->compileVariable('\'' . $match[1] . '\'')));
+        } else {
+            $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $this->compiler->compileVariable('\'' . $var . '\'')));
+        }
+    }
+
     #line 326 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r21()
     {
     #line 326 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r21()
     {
@@ -2339,7 +1353,8 @@ class Smarty_Internal_Templateparser
     #line 330 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r22()
     {
     #line 330 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r22()
     {
-        $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 2]->minor, 'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
+        $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value'        => $this->yystack[$this->yyidx + - 2]->minor,
+                                                                                                                                  'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
     #line 334 "../smarty/lexer/smarty_internal_templateparser.y"
     }
 
     #line 334 "../smarty/lexer/smarty_internal_templateparser.y"
@@ -2348,36 +1363,63 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
         $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
-    #line 338 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r24()
+    #line 348 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r27()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 2]->minor, 'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
+        $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value'        => $this->yystack[$this->yyidx + - 2]->minor,
+                                                                                                                                  'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
     }
 
-    #line 351 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r26()
+    #line 361 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r29()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[$this->yyidx + 0]->minor), array('var' => "'" . $this->yystack[$this->yyidx + - 2]->minor . "'")));
+        $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[$this->yyidx + 0]->minor),
+            array('var' => '\'' . substr($this->yystack[$this->yyidx + - 2]->minor, 1) . '\'')));
     }
 
     }
 
-    #line 359 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r28()
+    #line 369 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r31()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor), array('var' => "'" . $this->yystack[$this->yyidx + - 3]->minor . "'")), $this->yystack[$this->yyidx + 0]->minor));
+        $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor),
+                                                                                 array('var' => '\'' . substr($this->yystack[$this->yyidx + - 3]->minor, 1) . '\'')), $this->yystack[$this->yyidx + 0]->minor));
     }
 
     }
 
-    #line 363 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r29()
+    #line 373 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r32()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor), array('var' => $this->yystack[$this->yyidx + - 3]->minor['var'])), $this->yystack[$this->yyidx + 0]->minor), array('smarty_internal_index' => $this->yystack[$this->yyidx + - 3]->minor['smarty_internal_index']));
+        $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[$this->yyidx + - 1]->minor),
+                                                                                 array('var' => $this->yystack[$this->yyidx + - 3]->minor['var'])), $this->yystack[$this->yyidx + 0]->minor), array('smarty_internal_index' => $this->yystack[$this->yyidx + - 3]->minor['smarty_internal_index']));
+    }
+
+    #line 378 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r33()
+    {
+        $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->lex->ldel_length, - $this->lex->rdel_length));
+        if ($tag == 'strip') {
+            $this->strip = true;
+            $this->_retvalue = null;;
+        } else {
+            if (defined($tag)) {
+                if ($this->security) {
+                    $this->security->isTrustedConstant($tag, $this->compiler);
+                }
+                $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag));
+            } else {
+                if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) {
+                    $this->_retvalue = $this->compiler->compileTag($match[1], array('nocache'));
+                } else {
+                    $this->_retvalue = $this->compiler->compileTag($tag, array());
+                }
+            }
+        }
     }
 
     }
 
-    #line 368 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r30()
+    #line 400 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r34()
     {
         if (defined($this->yystack[$this->yyidx + - 1]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + - 1]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + - 1]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + - 1]->minor, $this->compiler);
             }
             $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 1]->minor));
         } else {
             }
             $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 1]->minor));
         } else {
@@ -2385,12 +1427,12 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 378 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r31()
+    #line 410 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r35()
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
             }
             $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $this->yystack[$this->yyidx + 0]->minor));
         } else {
             }
             $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $this->yystack[$this->yyidx + 0]->minor));
         } else {
@@ -2398,110 +1440,122 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 391 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r32()
+    #line 423 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r36()
     {
         if (defined($this->yystack[$this->yyidx + - 2]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + - 2]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + - 2]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + - 2]->minor, $this->compiler);
             }
             }
-            $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value' => $this->yystack[$this->yyidx + - 2]->minor, 'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
+            $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[$this->yyidx + 0]->minor, array('value'        => $this->yystack[$this->yyidx + - 2]->minor,
+                                                                                                                                      'modifierlist' => $this->yystack[$this->yyidx + - 1]->minor));
         } else {
             $this->_retvalue = '<?php ob_start();?>' . $this->compiler->compileTag($this->yystack[$this->yyidx + - 2]->minor, $this->yystack[$this->yyidx + 0]->minor) . '<?php echo ';
         } else {
             $this->_retvalue = '<?php ob_start();?>' . $this->compiler->compileTag($this->yystack[$this->yyidx + - 2]->minor, $this->yystack[$this->yyidx + 0]->minor) . '<?php echo ';
-            $this->_retvalue .= $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $this->yystack[$this->yyidx + - 1]->minor, 'value' => 'ob_get_clean()')) . ';?>';
+            $this->_retvalue .= $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $this->yystack[$this->yyidx + - 1]->minor,
+                                                                                               'value'        => 'ob_get_clean()')) . ';?>';
         }
     }
 
         }
     }
 
-    #line 404 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r33()
+    #line 436 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r37()
     {
         $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));
     }
 
     {
         $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 409 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r34()
+    #line 441 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r38()
     {
         $this->_retvalue = '<?php ob_start();?>' . $this->compiler->compileTag($this->yystack[$this->yyidx + - 4]->minor, $this->yystack[$this->yyidx + 0]->minor, array('object_method' => $this->yystack[$this->yyidx + - 2]->minor)) . '<?php echo ';
     {
         $this->_retvalue = '<?php ob_start();?>' . $this->compiler->compileTag($this->yystack[$this->yyidx + - 4]->minor, $this->yystack[$this->yyidx + 0]->minor, array('object_method' => $this->yystack[$this->yyidx + - 2]->minor)) . '<?php echo ';
-        $this->_retvalue .= $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $this->yystack[$this->yyidx + - 1]->minor, 'value' => 'ob_get_clean()')) . ';?>';
+        $this->_retvalue .= $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $this->yystack[$this->yyidx + - 1]->minor,
+                                                                                           'value'        => 'ob_get_clean()')) . ';?>';
     }
 
     }
 
-    #line 415 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r35()
+    #line 447 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r39()
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 420 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r36()
+    #line 452 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r40()
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 2]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, $this->yystack[$this->yyidx + 0]->minor, array('if condition' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 2]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, $this->yystack[$this->yyidx + 0]->minor, array('if condition' => $this->yystack[$this->yyidx + - 1]->minor));
     }
 
-    #line 425 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r37()
+    #line 457 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r41()
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $tag = trim(substr($this->yystack[$this->yyidx + - 1]->minor, $this->lex->ldel_length));
         $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), array('if condition' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 436 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r39()
+    #line 468 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r43()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('start' => $this->yystack[$this->yyidx + - 9]->minor), array('ifexp' => $this->yystack[$this->yyidx + - 6]->minor), array('var' => $this->yystack[$this->yyidx + - 2]->minor), array('step' => $this->yystack[$this->yyidx + - 1]->minor))), 1);
+        $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 440 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r40()
+    #line 472 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r44()
     {
         $this->_retvalue = '=' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '=' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 448 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r42()
+    #line 480 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r46()
     {
     {
-        $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);
+        $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 452 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r43()
+    #line 484 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r47()
     {
     {
-        $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);
+        $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 457 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r44()
+    #line 489 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r48()
     {
         $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 462 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r45()
+    #line 494 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r49()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('from' => $this->yystack[$this->yyidx + - 4]->minor), array('item' => $this->yystack[$this->yyidx + - 1]->minor))));
+        $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 466 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r46()
+    #line 498 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r50()
     {
     {
-        $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[$this->yyidx + 0]->minor, array(array('from' => $this->yystack[$this->yyidx + - 7]->minor), array('item' => $this->yystack[$this->yyidx + - 1]->minor), array('key' => $this->yystack[$this->yyidx + - 4]->minor))));
+        $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 479 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r49()
+    #line 511 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r53()
     {
         $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))));
     }
 
     {
         $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 483 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r50()
+    #line 515 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r54()
     {
         $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)));
     }
 
     {
         $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 488 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r51()
+    #line 520 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r55()
     {
         $j = strrpos($this->yystack[$this->yyidx + 0]->minor, '.');
         if ($this->yystack[$this->yyidx + 0]->minor[$j + 1] == 'c') {
     {
         $j = strrpos($this->yystack[$this->yyidx + 0]->minor, '.');
         if ($this->yystack[$this->yyidx + 0]->minor[$j + 1] == 'c') {
@@ -2513,228 +1567,220 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 501 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r52()
+    #line 533 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r56()
+    {
+        $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), ' /');
+        if ($tag == 'strip') {
+            $this->strip = false;
+            $this->_retvalue = null;
+        } else {
+            $this->_retvalue = $this->compiler->compileTag($tag . 'close', array());
+        }
+    }
+
+    #line 542 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r57()
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor . 'close', array());
     }
 
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor . 'close', array());
     }
 
-    #line 505 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r53()
+    #line 546 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r58()
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 1]->minor . 'close', array(), array('modifier_list' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 1]->minor . 'close', array(), array('modifier_list' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 510 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r54()
+    #line 551 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r59()
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 2]->minor . 'close', array(), array('object_method' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + - 2]->minor . 'close', array(), array('object_method' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 514 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r55()
+    #line 555 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r60()
     {
     {
-        $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));
+        $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 522 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r56()
+    #line 563 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r61()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
         $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
         $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 528 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r57()
+    #line 569 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r62()
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 533 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r58()
+    #line 574 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r63()
     {
         $this->_retvalue = array();
     }
 
     {
         $this->_retvalue = array();
     }
 
-    #line 538 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r59()
+    #line 579 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r64()
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
             }
             $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor);
         } else {
             }
             $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor);
         } else {
-            $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => "'" . $this->yystack[$this->yyidx + 0]->minor . "'");
+            $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => '\'' . $this->yystack[$this->yyidx + 0]->minor . '\'');
         }
     }
 
         }
     }
 
-    #line 549 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r60()
+    #line 590 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r65()
     {
         $this->_retvalue = array(trim($this->yystack[$this->yyidx + - 1]->minor, " =\n\r\t") => $this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = array(trim($this->yystack[$this->yyidx + - 1]->minor, " =\n\r\t") => $this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 557 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r62()
+    #line 598 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r67()
     {
     {
-        $this->_retvalue = "'" . $this->yystack[$this->yyidx + 0]->minor . "'";
+        $this->_retvalue = '\'' . $this->yystack[$this->yyidx + 0]->minor . '\'';
     }
 
     }
 
-    #line 569 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r65()
+    #line 610 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r70()
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor => $this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 582 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r67()
+    #line 623 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r72()
     {
         $this->yystack[$this->yyidx + - 2]->minor[] = $this->yystack[$this->yyidx + 0]->minor;
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor;
     }
 
     {
         $this->yystack[$this->yyidx + - 2]->minor[] = $this->yystack[$this->yyidx + 0]->minor;
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor;
     }
 
-    #line 587 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r68()
-    {
-        $this->_retvalue = array('var' => $this->yystack[$this->yyidx + - 2]->minor, 'value' => $this->yystack[$this->yyidx + 0]->minor);
-    }
-
-    #line 615 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 628 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r73()
     {
     function yy_r73()
     {
-        $this->_retvalue = '$_smarty_tpl->getStreamVariable(\'' . $this->yystack[$this->yyidx + - 2]->minor . '://' . $this->yystack[$this->yyidx + 0]->minor . '\')';
+        $this->_retvalue = array('var'   => '\'' . substr($this->yystack[$this->yyidx + - 2]->minor, 1) . '\'',
+                                 'value' => $this->yystack[$this->yyidx + 0]->minor);
     }
 
     }
 
-    #line 620 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r74()
+    #line 635 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r75()
     {
     {
-        $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . trim($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor;
+        $this->_retvalue = array('var'   => $this->yystack[$this->yyidx + - 2]->minor,
+                                 'value' => $this->yystack[$this->yyidx + 0]->minor);
     }
 
     }
 
-    #line 639 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r78()
-    {
-        $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), array('value' => $this->yystack[$this->yyidx + - 1]->minor, 'modifierlist' => $this->yystack[$this->yyidx + 0]->minor));
-    }
-
-    #line 645 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 659 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r79()
     {
     function yy_r79()
     {
-        $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
+        $this->_retvalue = '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[$this->yyidx + - 2]->minor, 1) . '://' . $this->yystack[$this->yyidx + 0]->minor . '\')';
     }
 
     }
 
-    #line 649 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 664 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r80()
     {
     function yy_r80()
     {
-        $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor . ')';
-    }
-
-    #line 653 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r81()
-    {
-        $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',(array)' . $this->yystack[$this->yyidx + 0]->minor . ')';
+        $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . trim($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     }
 
-    #line 661 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 678 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r83()
     {
     function yy_r83()
     {
-        $this->_retvalue = '!(' . $this->yystack[$this->yyidx + - 2]->minor . ' % ' . $this->yystack[$this->yyidx + 0]->minor . ')';
+        $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), array('value'        => $this->yystack[$this->yyidx + - 1]->minor,
+                                                                                          'modifierlist' => $this->yystack[$this->yyidx + 0]->minor));
     }
 
     }
 
-    #line 665 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 684 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r84()
     {
     function yy_r84()
     {
-        $this->_retvalue = '(' . $this->yystack[$this->yyidx + - 2]->minor . ' % ' . $this->yystack[$this->yyidx + 0]->minor . ')';
+        $this->_retvalue = (isset($this->yystack[$this->yyidx + - 1]->minor['pre']) ? $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 . (isset($this->yystack[$this->yyidx + - 1]->minor['pre']) ? ')' : '');
     }
 
     }
 
-    #line 669 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 687 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r85()
     {
     function yy_r85()
     {
-        $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')';
+        $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor . $this->yystack[$this->yyidx + - 1]->minor . ')';
     }
 
     }
 
-    #line 673 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 691 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r86()
     {
     function yy_r86()
     {
-        $this->_retvalue = '(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')';
+        $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor . ')';
     }
 
     }
 
-    #line 677 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 695 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r87()
     {
     function yy_r87()
     {
-        $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 2]->minor . ' / ' . $this->yystack[$this->yyidx + 0]->minor . ')';
+        $this->_retvalue = 'in_array(' . $this->yystack[$this->yyidx + - 2]->minor . ',(array)' . $this->yystack[$this->yyidx + 0]->minor . ')';
     }
 
     }
 
-    #line 681 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 699 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r88()
     function yy_r88()
-    {
-        $this->_retvalue = '(1 & ' . $this->yystack[$this->yyidx + - 2]->minor . ' / ' . $this->yystack[$this->yyidx + 0]->minor . ')';
-    }
-
-    #line 701 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r93()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 709 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r94()
+    #line 707 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r89()
     {
     {
-        $this->_retvalue = $this->yystack[$this->yyidx + - 6]->minor . ' ? ' . $this->compiler->compileVariable("'" . $this->yystack[$this->yyidx + - 2]->minor . "'") . ' : ' . $this->yystack[$this->yyidx + 0]->minor;
+        $this->_retvalue = $this->yystack[$this->yyidx + - 5]->minor . ' ? ' . $this->compiler->compileVariable('\'' . substr($this->yystack[$this->yyidx + - 2]->minor, 1) . '\'') . ' : ' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     }
 
-    #line 713 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r95()
+    #line 711 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r90()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 5]->minor . ' ? ' . $this->yystack[$this->yyidx + - 2]->minor . ' : ' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 5]->minor . ' ? ' . $this->yystack[$this->yyidx + - 2]->minor . ' : ' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 728 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r98()
+    #line 726 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r93()
     {
         $this->_retvalue = '!' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '!' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 749 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r103()
+    #line 747 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r98()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 753 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r104()
+    #line 751 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r99()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.';
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.';
     }
 
-    #line 757 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r105()
+    #line 755 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r100()
     {
         $this->_retvalue = '.' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '.' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 762 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r106()
+    #line 760 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r101()
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
             }
             $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
         } else {
             }
             $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
         } else {
-            $this->_retvalue = "'" . $this->yystack[$this->yyidx + 0]->minor . "'";
+            $this->_retvalue = '\'' . $this->yystack[$this->yyidx + 0]->minor . '\'';
         }
     }
 
         }
     }
 
-    #line 779 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r108()
+    #line 777 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r103()
     {
         $this->_retvalue = "(" . $this->yystack[$this->yyidx + - 1]->minor . ")";
     }
 
     {
         $this->_retvalue = "(" . $this->yystack[$this->yyidx + - 1]->minor . ")";
     }
 
-    #line 794 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r111()
+    #line 792 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r106()
     {
         self::$prefix_number ++;
         if ($this->yystack[$this->yyidx + - 2]->minor['var'] == '\'smarty\'') {
     {
         self::$prefix_number ++;
         if ($this->yystack[$this->yyidx + - 2]->minor['var'] == '\'smarty\'') {
@@ -2745,18 +1791,21 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = '$_tmp' . self::$prefix_number . '::' . $this->yystack[$this->yyidx + 0]->minor[0] . $this->yystack[$this->yyidx + 0]->minor[1];
     }
 
         $this->_retvalue = '$_tmp' . self::$prefix_number . '::' . $this->yystack[$this->yyidx + 0]->minor[0] . $this->yystack[$this->yyidx + 0]->minor[1];
     }
 
-    #line 806 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r112()
+    #line 803 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r107()
     {
         self::$prefix_number ++;
     {
         self::$prefix_number ++;
-        $this->compiler->prefix_code[] = '<?php ob_start();?>' . $this->yystack[$this->yyidx + - 1]->minor . '<?php $_tmp' . self::$prefix_number . '=ob_get_clean();?>';
+        $tmp = $this->compiler->appendCode('<?php ob_start();?>', $this->yystack[$this->yyidx + 0]->minor);
+        $this->compiler->prefix_code[] = $this->compiler->appendCode($tmp, '<?php $_tmp' . self::$prefix_number . '=ob_get_clean();?>');
         $this->_retvalue = '$_tmp' . self::$prefix_number;
     }
 
         $this->_retvalue = '$_tmp' . self::$prefix_number;
     }
 
-    #line 822 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r115()
+    #line 820 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r110()
     {
     {
-        if (!in_array(strtolower($this->yystack[$this->yyidx + - 2]->minor), array('self', 'parent')) && (!$this->security || $this->smarty->security_policy->isTrustedStaticClassAccess($this->yystack[$this->yyidx + - 2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) {
+        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];
             } else {
             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];
             } else {
@@ -2767,8 +1816,14 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 856 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r119()
+    #line 854 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r113()
+    {
+        $this->_retvalue = $this->compiler->compileVariable('\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\'');
+    }
+
+    #line 857 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r114()
     {
         if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') {
             $smarty_var = $this->compiler->compileTag('private_special_variable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);
     {
         if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') {
             $smarty_var = $this->compiler->compileTag('private_special_variable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);
@@ -2781,123 +1836,162 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 869 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r120()
+    #line 870 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r115()
     {
         $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[$this->yyidx + - 2]->minor . ']->' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[$this->yyidx + - 2]->minor . ']->' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 879 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r122()
+    #line 880 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r117()
     {
         $this->_retvalue = '$_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 1]->minor . '\')';
     }
 
     {
         $this->_retvalue = '$_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 1]->minor . '\')';
     }
 
-    #line 883 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r123()
+    #line 884 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r118()
     {
         $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 2]->minor . '\')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' :null)';
     }
 
     {
         $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( \'' . $this->yystack[$this->yyidx + - 2]->minor . '\')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' :null)';
     }
 
-    #line 887 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r124()
+    #line 888 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r119()
     {
         $this->_retvalue = '$_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 1]->minor . ')';
     }
 
     {
         $this->_retvalue = '$_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 1]->minor . ')';
     }
 
-    #line 891 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r125()
+    #line 892 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r120()
     {
         $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 2]->minor . ')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' : null)';
     }
 
     {
         $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable( ' . $this->yystack[$this->yyidx + - 2]->minor . ')) ? $tmp' . $this->yystack[$this->yyidx + 0]->minor . ' : null)';
     }
 
-    #line 895 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r126()
+    #line 896 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r121()
     {
     {
-        $this->_retvalue = array('var' => $this->yystack[$this->yyidx + - 1]->minor, 'smarty_internal_index' => $this->yystack[$this->yyidx + 0]->minor);
+        $this->_retvalue = array('var'                   => '\'' . substr($this->yystack[$this->yyidx + - 1]->minor, 1) . '\'',
+                                 'smarty_internal_index' => $this->yystack[$this->yyidx + 0]->minor);
     }
 
     }
 
-    #line 908 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r128()
+    #line 899 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r122()
+    {
+        $this->_retvalue = array('var'                   => $this->yystack[$this->yyidx + - 1]->minor,
+                                 'smarty_internal_index' => $this->yystack[$this->yyidx + 0]->minor);
+    }
+
+    #line 912 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r124()
     {
         return;
     }
 
     {
         return;
     }
 
-    #line 914 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r129()
+    #line 918 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r125()
+    {
+        $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\'') . ']';
+    }
+
+    #line 921 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r126()
     {
         $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor) . ']';
     }
 
     {
         $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor) . ']';
     }
 
-    #line 918 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r130()
+    #line 925 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r127()
     {
         $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[$this->yyidx + - 2]->minor) . '->' . $this->yystack[$this->yyidx + 0]->minor . ']';
     }
 
     {
         $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[$this->yyidx + - 2]->minor) . '->' . $this->yystack[$this->yyidx + 0]->minor . ']';
     }
 
-    #line 922 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r131()
+    #line 929 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r128()
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
     {
         if (defined($this->yystack[$this->yyidx + 0]->minor)) {
-            if (isset($this->smarty->security_policy)) {
-                $this->smarty->security_policy->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
+            if ($this->security) {
+                $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler);
             }
             }
-            $this->_retvalue = "[" . $this->yystack[$this->yyidx + 0]->minor . "]";
+            $this->_retvalue = '[' . $this->yystack[$this->yyidx + 0]->minor . ']';
         } else {
             $this->_retvalue = "['" . $this->yystack[$this->yyidx + 0]->minor . "']";
         }
     }
 
         } else {
             $this->_retvalue = "['" . $this->yystack[$this->yyidx + 0]->minor . "']";
         }
     }
 
-    #line 933 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r132()
+    #line 940 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r129()
     {
     {
-        $this->_retvalue = "[" . $this->yystack[$this->yyidx + 0]->minor . "]";
+        $this->_retvalue = '[' . $this->yystack[$this->yyidx + 0]->minor . ']';
     }
 
     }
 
-    #line 938 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r133()
+    #line 945 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r130()
     {
     {
-        $this->_retvalue = "[" . $this->yystack[$this->yyidx + - 1]->minor . "]";
+        $this->_retvalue = '[' . $this->yystack[$this->yyidx + - 1]->minor . ']';
     }
 
     }
 
-    #line 943 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r134()
+    #line 950 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r131()
     {
         $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\'][\'index\']') . ']';
     }
 
     {
         $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\'][\'index\']') . ']';
     }
 
-    #line 947 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r135()
+    #line 954 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r132()
     {
         $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 3]->minor . '\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\']') . ']';
     }
 
     #line 957 "../smarty/lexer/smarty_internal_templateparser.y"
     {
         $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . $this->yystack[$this->yyidx + - 3]->minor . '\'][\'' . $this->yystack[$this->yyidx + - 1]->minor . '\']') . ']';
     }
 
     #line 957 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r137()
+    function yy_r133()
     {
     {
-        $this->_retvalue = '[]';
+        $this->_retvalue = '[' . $this->yystack[$this->yyidx + - 1]->minor . ']';
     }
 
     }
 
-    #line 971 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 963 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r135()
+    {
+        $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[$this->yyidx + - 1]->minor, 1) . '\'') . ']';;
+    }
+
+    #line 979 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r139()
     {
     function yy_r139()
     {
-        $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor;
+        $this->_retvalue = '[]';
     }
 
     }
 
-    #line 976 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 989 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r140()
     {
     function yy_r140()
     {
-        $this->_retvalue = '\'' . $this->yystack[$this->yyidx + 0]->minor . '\'';
+        $this->_retvalue = '\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\'';
     }
 
     }
 
-    #line 981 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 993 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r141()
     {
     function yy_r141()
     {
-        $this->_retvalue = '(' . $this->yystack[$this->yyidx + - 1]->minor . ')';
+        $this->_retvalue = "''";
     }
 
     }
 
-    #line 988 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 998 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r142()
     function yy_r142()
+    {
+        $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . '.' . $this->yystack[$this->yyidx + 0]->minor;
+    }
+
+    #line 1006 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r144()
+    {
+        $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), ' $');
+        $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\'');
+    }
+
+    #line 1012 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r145()
+    {
+        $this->_retvalue = '(' . $this->yystack[$this->yyidx + - 1]->minor . ')';
+    }
+
+    #line 1019 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r146()
     {
         if ($this->yystack[$this->yyidx + - 1]->minor['var'] == '\'smarty\'') {
             $this->_retvalue = $this->compiler->compileTag('private_special_variable', array(), $this->yystack[$this->yyidx + - 1]->minor['smarty_internal_index']) . $this->yystack[$this->yyidx + 0]->minor;
     {
         if ($this->yystack[$this->yyidx + - 1]->minor['var'] == '\'smarty\'') {
             $this->_retvalue = $this->compiler->compileTag('private_special_variable', array(), $this->yystack[$this->yyidx + - 1]->minor['smarty_internal_index']) . $this->yystack[$this->yyidx + 0]->minor;
@@ -2906,20 +2000,20 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 997 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r143()
+    #line 1028 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r147()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1002 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r144()
+    #line 1033 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r148()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1007 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r145()
+    #line 1038 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r149()
     {
         if ($this->security && substr($this->yystack[$this->yyidx + - 1]->minor, 0, 1) == '_') {
             $this->compiler->trigger_template_error(self::Err1);
     {
         if ($this->security && substr($this->yystack[$this->yyidx + - 1]->minor, 0, 1) == '_') {
             $this->compiler->trigger_template_error(self::Err1);
@@ -2927,8 +2021,8 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = '->' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
         $this->_retvalue = '->' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1014 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r146()
+    #line 1045 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r150()
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
@@ -2936,8 +2030,8 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor . '}';
     }
 
         $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[$this->yyidx + - 1]->minor) . $this->yystack[$this->yyidx + 0]->minor . '}';
     }
 
-    #line 1021 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r147()
+    #line 1052 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r151()
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
@@ -2945,8 +2039,8 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = '->{' . $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + 0]->minor . '}';
     }
 
         $this->_retvalue = '->{' . $this->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + 0]->minor . '}';
     }
 
-    #line 1028 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r148()
+    #line 1059 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r152()
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
@@ -2954,16 +2048,16 @@ class Smarty_Internal_Templateparser
         $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->yystack[$this->yyidx + - 2]->minor . $this->yystack[$this->yyidx + 0]->minor . '}';
     }
 
-    #line 1036 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r149()
+    #line 1067 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r153()
     {
         $this->_retvalue = '->' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '->' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1044 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r150()
+    #line 1075 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r154()
     {
     {
-        if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + - 3]->minor, $this->compiler)) {
+        if (!$this->security || $this->security->isTrustedPhpFunction($this->yystack[$this->yyidx + - 3]->minor, $this->compiler)) {
             if (strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'array') === 0 || is_callable($this->yystack[$this->yyidx + - 3]->minor)) {
                 $func_name = strtolower($this->yystack[$this->yyidx + - 3]->minor);
                 if ($func_name == 'isset') {
             if (strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + - 3]->minor, 'array') === 0 || is_callable($this->yystack[$this->yyidx + - 3]->minor)) {
                 $func_name = strtolower($this->yystack[$this->yyidx + - 3]->minor);
                 if ($func_name == 'isset') {
@@ -2997,8 +2091,8 @@ class Smarty_Internal_Templateparser
         }
     }
 
         }
     }
 
-    #line 1083 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r151()
+    #line 1114 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r155()
     {
         if ($this->security && substr($this->yystack[$this->yyidx + - 3]->minor, 0, 1) == '_') {
             $this->compiler->trigger_template_error(self::Err1);
     {
         if ($this->security && substr($this->yystack[$this->yyidx + - 3]->minor, 0, 1) == '_') {
             $this->compiler->trigger_template_error(self::Err1);
@@ -3006,224 +2100,190 @@ class Smarty_Internal_Templateparser
         $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . "(" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ")";
     }
 
         $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . "(" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ")";
     }
 
-    #line 1090 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r152()
+    #line 1121 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r156()
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
         }
         self::$prefix_number ++;
     {
         if ($this->security) {
             $this->compiler->trigger_template_error(self::Err2);
         }
         self::$prefix_number ++;
-        $this->compiler->prefix_code[] = '<?php $_tmp' . self::$prefix_number . '=' . $this->compiler->compileVariable("'" . $this->yystack[$this->yyidx + - 3]->minor . "'") . ';?>';
+        $this->compiler->prefix_code[] = '<?php $_tmp' . self::$prefix_number . '=' . $this->compiler->compileVariable('\'' . substr($this->yystack[$this->yyidx + - 3]->minor, 1) . '\'') . ';?>';
         $this->_retvalue = '$_tmp' . self::$prefix_number . '(' . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ')';
     }
 
         $this->_retvalue = '$_tmp' . self::$prefix_number . '(' . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . ')';
     }
 
-    #line 1101 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r153()
+    #line 1132 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r157()
     {
         $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 2]->minor, array($this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 2]->minor, array($this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 1118 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r156()
+    #line 1149 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r160()
     {
         $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)));
     }
 
     {
         $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 1122 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r157()
+    #line 1153 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r161()
     {
         $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor));
     }
 
     {
         $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor));
     }
 
-    #line 1130 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r159()
+    #line 1161 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r163()
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 1138 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r160()
-    {
-        $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor);
-    }
-
-    #line 1157 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1169 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r164()
     {
     function yy_r164()
     {
-        $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method');
-    }
-
-    #line 1162 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r165()
-    {
-        $this->_retvalue = array($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method');
-    }
-
-    #line 1167 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r166()
-    {
-        $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '');
-    }
-
-    #line 1172 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r167()
-    {
-        $this->_retvalue = array('$' . $this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property');
+        $this->_retvalue = array_merge($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor);
     }
 
     }
 
-    #line 1177 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1188 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r168()
     {
     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');
+        $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method');
     }
 
     }
 
-    #line 1183 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1193 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r169()
     {
     function yy_r169()
     {
-        $this->_retvalue = '==';
+        $this->_retvalue = array($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor,
+            'method');
     }
 
     }
 
-    #line 1187 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1198 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r170()
     {
     function yy_r170()
     {
-        $this->_retvalue = '!=';
+        $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '');
     }
 
     }
 
-    #line 1191 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1203 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r171()
     {
     function yy_r171()
     {
-        $this->_retvalue = '>';
+        $this->_retvalue = array($this->yystack[$this->yyidx + - 1]->minor, $this->yystack[$this->yyidx + 0]->minor,
+            'property');
     }
 
     }
 
-    #line 1195 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1208 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r172()
     {
     function yy_r172()
     {
-        $this->_retvalue = '<';
+        $this->_retvalue = array($this->yystack[$this->yyidx + - 2]->minor,
+            $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor, 'property');
     }
 
     }
 
-    #line 1199 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1214 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r173()
     {
     function yy_r173()
     {
-        $this->_retvalue = '>=';
+        $this->_retvalue['op'] = ' ' . trim($this->yystack[$this->yyidx + 0]->minor) . ' ';
     }
 
     }
 
-    #line 1203 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1218 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r174()
     {
     function yy_r174()
     {
-        $this->_retvalue = '<=';
-    }
-
-    #line 1207 "../smarty/lexer/smarty_internal_templateparser.y"
+        static $lops = array('eq'          => array('op' => ' == ', 'pre' => null),
+                             'ne'          => array('op' => ' != ', 'pre' => null),
+                             'neq'         => array('op' => ' != ', 'pre' => null),
+                             'gt'          => array('op' => ' > ', 'pre' => null),
+                             'ge'          => array('op' => ' >= ', 'pre' => null),
+                             'gte'         => array('op' => ' >= ', 'pre' => null),
+                             'lt'          => array('op' => ' < ', 'pre' => null),
+                             'le'          => array('op' => ' <= ', 'pre' => null),
+                             'lte'         => array('op' => ' <= ', 'pre' => null),
+                             'mod'         => array('op' => ' % ', 'pre' => null),
+                             'and'         => array('op' => ' && ', 'pre' => null),
+                             'or'          => array('op' => ' || ', 'pre' => null),
+                             'xor'         => array('op' => ' xor ', 'pre' => null),
+                             'isdivby'     => array('op' => ' % ', 'pre' => '!('),
+                             'isnotdivby'  => array('op' => ' % ', 'pre' => '('),
+                             'isevenby'    => array('op' => ' / ', 'pre' => '!(1 & '),
+                             'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '),
+                             'isoddby'     => array('op' => ' / ', 'pre' => '(1 & '),
+                             'isnotoddby'  => array('op' => ' / ', 'pre' => '!(1 & '),);
+        $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor));
+        $this->_retvalue = $lops[$op];
+    }
+
+    #line 1244 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r175()
     {
     function yy_r175()
     {
-        $this->_retvalue = '===';
+        static $scond = array('iseven'   => '!(1 & ', 'isnoteven' => '(1 & ', 'isodd' => '(1 & ',
+                              'isnotodd' => '!(1 & ',);
+        $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor));
+        $this->_retvalue = $scond[$op];
     }
 
     }
 
-    #line 1211 "../smarty/lexer/smarty_internal_templateparser.y"
+    #line 1258 "../smarty/lexer/smarty_internal_templateparser.y"
     function yy_r176()
     function yy_r176()
-    {
-        $this->_retvalue = '!==';
-    }
-
-    #line 1215 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r177()
-    {
-        $this->_retvalue = '%';
-    }
-
-    #line 1219 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r178()
-    {
-        $this->_retvalue = '&&';
-    }
-
-    #line 1223 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r179()
-    {
-        $this->_retvalue = '||';
-    }
-
-    #line 1227 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r180()
-    {
-        $this->_retvalue = ' XOR ';
-    }
-
-    #line 1234 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r181()
     {
         $this->_retvalue = 'array(' . $this->yystack[$this->yyidx + - 1]->minor . ')';
     }
 
     {
         $this->_retvalue = 'array(' . $this->yystack[$this->yyidx + - 1]->minor . ')';
     }
 
-    #line 1242 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r183()
+    #line 1266 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r178()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . ',' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1250 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r185()
+    #line 1274 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r180()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '=>' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 2]->minor . '=>' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1254 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r186()
+    #line 1278 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r181()
     {
         $this->_retvalue = '\'' . $this->yystack[$this->yyidx + - 2]->minor . '\'=>' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
     {
         $this->_retvalue = '\'' . $this->yystack[$this->yyidx + - 2]->minor . '\'=>' . $this->yystack[$this->yyidx + 0]->minor;
     }
 
-    #line 1266 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r188()
-    {
-        $this->_retvalue = "''";
-    }
-
-    #line 1270 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r189()
+    #line 1294 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r184()
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor->to_smarty_php();
     }
 
     {
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor->to_smarty_php();
     }
 
-    #line 1275 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r190()
+    #line 1299 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r185()
     {
         $this->yystack[$this->yyidx + - 1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor);
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
     }
 
     {
         $this->yystack[$this->yyidx + - 1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor);
         $this->_retvalue = $this->yystack[$this->yyidx + - 1]->minor;
     }
 
-    #line 1280 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r191()
+    #line 1304 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r186()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[$this->yyidx + 0]->minor);
     }
 
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[$this->yyidx + 0]->minor);
     }
 
-    #line 1284 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r192()
+    #line 1308 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r187()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)' . $this->yystack[$this->yyidx + - 1]->minor);
     }
 
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)' . $this->yystack[$this->yyidx + - 1]->minor);
     }
 
-    #line 1292 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r194()
+    #line 1316 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r189()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)$_smarty_tpl->tpl_vars[\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\']->value');
     }
 
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)$_smarty_tpl->tpl_vars[\'' . substr($this->yystack[$this->yyidx + 0]->minor, 1) . '\']->value');
     }
 
-    #line 1300 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r196()
+    #line 1324 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r191()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')');
     }
 
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_Code($this, '(string)(' . $this->yystack[$this->yyidx + - 1]->minor . ')');
     }
 
-    #line 1304 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r197()
+    #line 1328 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r192()
     {
     {
-        $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[$this->yyidx + - 1]->minor);
+        $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[$this->yyidx + 0]->minor);
     }
 
     }
 
-    #line 1308 "../smarty/lexer/smarty_internal_templateparser.y"
-    function yy_r198()
+    #line 1332 "../smarty/lexer/smarty_internal_templateparser.y"
+    function yy_r193()
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this, $this->yystack[$this->yyidx + 0]->minor);
     }
     {
         $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this, $this->yystack[$this->yyidx + 0]->minor);
     }
@@ -3232,17 +2292,12 @@ class Smarty_Internal_Templateparser
 
     public function yy_reduce($yyruleno)
     {
 
     public function yy_reduce($yyruleno)
     {
-        $yymsp = $this->yystack[$this->yyidx];
-        if ($this->yyTraceFILE && $yyruleno >= 0
-            && $yyruleno < count(self::$yyRuleName)
-        ) {
-            fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n",
-                    $this->yyTracePrompt, $yyruleno,
-                    self::$yyRuleName[$yyruleno]);
+        if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) {
+            fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, self::$yyRuleName[$yyruleno]);
         }
 
         $this->_retvalue = $yy_lefthand_side = null;
         }
 
         $this->_retvalue = $yy_lefthand_side = null;
-        if (array_key_exists($yyruleno, self::$yyReduceMap)) {
+        if (isset(self::$yyReduceMap[$yyruleno])) {
             // call the action
             $this->_retvalue = null;
             $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
             // call the action
             $this->_retvalue = null;
             $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
@@ -3284,7 +2339,7 @@ class Smarty_Internal_Templateparser
 
     public function yy_syntax_error($yymajor, $TOKEN)
     {
 
     public function yy_syntax_error($yymajor, $TOKEN)
     {
-        #line 177 "../smarty/lexer/smarty_internal_templateparser.y"
+        #line 183 "../smarty/lexer/smarty_internal_templateparser.y"
 
         $this->internalError = true;
         $this->yymajor = $yymajor;
 
         $this->internalError = true;
         $this->yymajor = $yymajor;
@@ -3299,7 +2354,7 @@ class Smarty_Internal_Templateparser
         while ($this->yyidx >= 0) {
             $this->yy_pop_parser_stack();
         }
         while ($this->yyidx >= 0) {
             $this->yy_pop_parser_stack();
         }
-        #line 170 "../smarty/lexer/smarty_internal_templateparser.y"
+        #line 176 "../smarty/lexer/smarty_internal_templateparser.y"
 
         $this->successful = !$this->internalError;
         $this->internalError = false;
 
         $this->successful = !$this->internalError;
         $this->internalError = false;
@@ -3317,20 +2372,17 @@ class Smarty_Internal_Templateparser
             $x->stateno = 0;
             $x->major = 0;
             $this->yystack = array();
             $x->stateno = 0;
             $x->major = 0;
             $this->yystack = array();
-            array_push($this->yystack, $x);
+            $this->yystack[] = $x;
         }
         $yyendofinput = ($yymajor == 0);
 
         if ($this->yyTraceFILE) {
         }
         $yyendofinput = ($yymajor == 0);
 
         if ($this->yyTraceFILE) {
-            fprintf($this->yyTraceFILE, "%sInput %s\n",
-                    $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
+            fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
         }
 
         do {
             $yyact = $this->yy_find_shift_action($yymajor);
         }
 
         do {
             $yyact = $this->yy_find_shift_action($yymajor);
-            if ($yymajor < self::YYERRORSYMBOL &&
-                !$this->yy_is_expected_token($yymajor)
-            ) {
+            if ($yymajor < self::YYERRORSYMBOL && !$this->yy_is_expected_token($yymajor)) {
                 // force a syntax error
                 $yyact = self::YY_ERROR_ACTION;
             }
                 // force a syntax error
                 $yyact = self::YY_ERROR_ACTION;
             }
@@ -3346,8 +2398,7 @@ class Smarty_Internal_Templateparser
                 $this->yy_reduce($yyact - self::YYNSTATE);
             } elseif ($yyact == self::YY_ERROR_ACTION) {
                 if ($this->yyTraceFILE) {
                 $this->yy_reduce($yyact - self::YYNSTATE);
             } elseif ($yyact == self::YY_ERROR_ACTION) {
                 if ($this->yyTraceFILE) {
-                    fprintf($this->yyTraceFILE, "%sSyntax Error!\n",
-                            $this->yyTracePrompt);
+                    fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt);
                 }
                 if (self::YYERRORSYMBOL) {
                     if ($this->yyerrcnt < 0) {
                 }
                 if (self::YYERRORSYMBOL) {
                     if ($this->yyerrcnt < 0) {
@@ -3356,16 +2407,12 @@ class Smarty_Internal_Templateparser
                     $yymx = $this->yystack[$this->yyidx]->major;
                     if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) {
                         if ($this->yyTraceFILE) {
                     $yymx = $this->yystack[$this->yyidx]->major;
                     if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) {
                         if ($this->yyTraceFILE) {
-                            fprintf($this->yyTraceFILE, "%sDiscard input token %s\n",
-                                    $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
+                            fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, $this->yyTokenName[$yymajor]);
                         }
                         $this->yy_destructor($yymajor, $yytokenvalue);
                         $yymajor = self::YYNOCODE;
                     } else {
                         }
                         $this->yy_destructor($yymajor, $yytokenvalue);
                         $yymajor = self::YYNOCODE;
                     } else {
-                        while ($this->yyidx >= 0 &&
-                            $yymx != self::YYERRORSYMBOL &&
-                            ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
-                        ) {
+                        while ($this->yyidx >= 0 && $yymx != self::YYERRORSYMBOL && ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE) {
                             $this->yy_pop_parser_stack();
                         }
                         if ($this->yyidx < 0 || $yymajor == 0) {
                             $this->yy_pop_parser_stack();
                         }
                         if ($this->yyidx < 0 || $yymajor == 0) {
index 5a70c61837a47c3c2f1da6819343587ced083f00..af1ca5531fde0c96a3504fd0dfb7bde1f20e1c2a 100644 (file)
@@ -108,7 +108,6 @@ class Smarty_Security
         'count', 'sizeof',
         'in_array', 'is_array',
         'time',
         'count', 'sizeof',
         'in_array', 'is_array',
         'time',
-        'nl2br',
     );
     /**
      * This is an array of trusted PHP modifiers.
     );
     /**
      * This is an array of trusted PHP modifiers.
@@ -119,7 +118,8 @@ class Smarty_Security
      */
     public $php_modifiers = array(
         'escape',
      */
     public $php_modifiers = array(
         'escape',
-        'count'
+        'count',
+        'nl2br',
     );
     /**
      * This is an array of allowed tags.
     );
     /**
      * This is an array of allowed tags.