cvs: smarty /libs Smarty_Compiler.class.php
"Monte Ohrt" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsmohrt1094746195@cvsserver> |
mohrt Thu Sep 9 12:09:55 2004 EDT
Modified files:
/smarty/libs Smarty_Compiler.class.php
Log:
fix object parameter regex, allow one level of object indirection
http://cvs.php.net/diff.php/smarty/libs/Smarty_Compiler.class.php?r1=1.337&r2=1.338&ty=u
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.337 smarty/libs/Smarty_Compiler.class.php:1.338
--- smarty/libs/Smarty_Compiler.class.php:1.337 Thu Sep 9 09:40:14 2004
+++ smarty/libs/Smarty_Compiler.class.php Thu Sep 9 12:09:55 2004
@@ -26,7 +26,7 @@
* @package Smarty
*/
-/* $Id: Smarty_Compiler.class.php,v 1.337 2004/09/09 13:40:14 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.338 2004/09/09 16:09:55 mohrt Exp $ */
/**
* Template compiling class
@@ -137,7 +137,7 @@
// #foo#
// "text"
// "text"
- $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
+ $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_num_const_regexp . '|' . $this->_qstr_regexp . ')';
// matches valid object call (no objects allowed in parameters):
// $foo->bar
@@ -148,8 +148,11 @@
// $foo->bar->foo()
// $foo->bar->foo->bar()
$this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
- $this->_obj_params_regexp = '\((?:(?:' . $this->_num_const_regexp . ')|\w+|'
- . $this->_var_regexp . '(?:\s*,\s*(?:(?:\w+|'
+ $this->_obj_params_regexp = '\((?:\w+|(?:'
+ . $this->_var_regexp . '(?:' . $this->_obj_ext_regexp
+ . '(?:\((?:' . $this->_var_regexp
+ . '(?:\s*,\s*' . $this->_var_regexp
+ . ')*)?\))?)*)(?:\s*,\s*(?:(?:\w+|'
. $this->_var_regexp . ')))*)?\)';
$this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
$this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?)';
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php