From f4961b6950688492b5c5c39f1f3b13da7ab1529b Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 3 Feb 2003 15:46:11 +0000 Subject: [PATCH] allow $foo->bar[$x].foo syntax --- Smarty_Compiler.class.php | 18 ++++++++---------- libs/Smarty_Compiler.class.php | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 6fcfdbe2..95d16040 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -55,7 +55,7 @@ class Smarty_Compiler extends Smarty { var $_si_qstr_regexp = null; var $_qstr_regexp = null; var $_func_regexp = null; - var $_dvar__gets_regexp = null; + var $_dvar_guts_regexp = null; var $_dvar_regexp = null; var $_cvar_regexp = null; var $_svar_regexp = null; @@ -87,13 +87,13 @@ class Smarty_Compiler extends Smarty { $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')'; // matches $ vars (not objects): - // foo - // foo.bar - // foo.bar.foobar - // foo[0] - // foo[$bar] - // foo[5][blah] - // foo[5].bar[$foobar][4] + // $foo + // $foo.bar + // $foo.bar.foobar + // $foo[0] + // $foo[$bar] + // $foo[5][blah] + // $foo[5].bar[$foobar][4] $this->_dvar_guts_regexp = '\w+(?:\[\$?[\w\.]+\])*(?:\.\$?\w+(?:\[\$?[\w\.]+\])*)*'; $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; @@ -132,8 +132,6 @@ class Smarty_Compiler extends Smarty { // matches valid object call (no objects allowed in parameters): // $foo->bar - // $foo->bar[0] - // $foo->bar[$x].foobar // $foo->bar() // $foo->bar("text") // $foo->bar($foo, $bar, "text") diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 6fcfdbe2..95d16040 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -55,7 +55,7 @@ class Smarty_Compiler extends Smarty { var $_si_qstr_regexp = null; var $_qstr_regexp = null; var $_func_regexp = null; - var $_dvar__gets_regexp = null; + var $_dvar_guts_regexp = null; var $_dvar_regexp = null; var $_cvar_regexp = null; var $_svar_regexp = null; @@ -87,13 +87,13 @@ class Smarty_Compiler extends Smarty { $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')'; // matches $ vars (not objects): - // foo - // foo.bar - // foo.bar.foobar - // foo[0] - // foo[$bar] - // foo[5][blah] - // foo[5].bar[$foobar][4] + // $foo + // $foo.bar + // $foo.bar.foobar + // $foo[0] + // $foo[$bar] + // $foo[5][blah] + // $foo[5].bar[$foobar][4] $this->_dvar_guts_regexp = '\w+(?:\[\$?[\w\.]+\])*(?:\.\$?\w+(?:\[\$?[\w\.]+\])*)*'; $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; @@ -132,8 +132,6 @@ class Smarty_Compiler extends Smarty { // matches valid object call (no objects allowed in parameters): // $foo->bar - // $foo->bar[0] - // $foo->bar[$x].foobar // $foo->bar() // $foo->bar("text") // $foo->bar($foo, $bar, "text")