- bugfix {if $foo instanceof $bar} failed to compile if 2nd value is a variable https://github.com/smarty-php/smarty/issues/92

This commit is contained in:
uwetews
2015-10-08 19:45:42 +02:00
parent 7f0a2f788f
commit 428e667453

View File

@@ -31,58 +31,68 @@ class Smarty_Internal_Templateparser
* @var bool
*/
public $successful = true;
/**
* return value
*
* @var mixed
*/
public $retvalue = 0;
/**
* counter for prefix code
*
* @var int
*/
public static $prefix_number = 0;
/**
* @var
*/
public $yymajor;
/**
* last index of array variable
*
* @var mixed
*/
public $last_index;
/**
* last variable name
*
* @var string
*/
public $last_variable;
/**
* root parse tree buffer
*
* @var Smarty_Internal_ParseTree
*/
public $root_buffer;
/**
* current parse tree object
*
* @var Smarty_Internal_ParseTree
*/
public $current_buffer;
/**
* lexer object
*
* @var Smarty_Internal_Templatelexer
*/
public $lex;
/**
* internal error flag
*
* @var bool
*/
private $internalError = false;
/**
* {strip} status
*
@@ -95,18 +105,21 @@ class Smarty_Internal_Templateparser
* @var Smarty_Internal_TemplateCompilerBase
*/
public $compiler = null;
/**
* smarty object
*
* @var Smarty
*/
public $smarty = null;
/**
* template object
*
* @var Smarty_Internal_Template
*/
public $template = null;
/**
* block nesting level
*
@@ -121,6 +134,20 @@ class Smarty_Internal_Templateparser
*/
public $security = null;
/**
* template prefix array
*
* @var \Smarty_Internal_ParseTree[]
*/
public $template_prefix = array();
/**
* security object
*
* @var \Smarty_Internal_ParseTree[]
*/
public $template_postfix = array();
/**
* constructor
*
@@ -196,7 +223,8 @@ class Smarty_Internal_Templateparser
// complete template
//
start(res) ::= template. {
$this->compiler->processInheritance($this);
$this->root_buffer->prepend_array($this, $this->template_prefix);
$this->root_buffer->append_array($this, $this->template_postfix);
res = $this->root_buffer->to_smarty_php($this);
}
@@ -839,11 +867,7 @@ ns1(res) ::= ID(i). {
ns1(res) ::= NAMESPACE(i). {
res = i;
}
//ns1(res) ::= variable(v). {
// res = v;
//}
}