cvs: smarty /libs Smarty_Compiler.class.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1094737215@cvsserver>
mohrt		Thu Sep  9 09:40:15 2004 EDT

  Modified files:              
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  fix compile problem with numeric constants and math operator matching
  
  
http://cvs.php.net/diff.php/smarty/libs/Smarty_Compiler.class.php?r1=1.336&r2=1.337&ty=u
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.336 smarty/libs/Smarty_Compiler.class.php:1.337
--- smarty/libs/Smarty_Compiler.class.php:1.336	Tue Sep  7 10:48:55 2004
+++ smarty/libs/Smarty_Compiler.class.php	Thu Sep  9 09:40:14 2004
@@ -26,7 +26,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.336 2004/09/07 14:48:55 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.337 2004/09/09 13:40:14 mohrt Exp $ */
 
 /**
  * Template compiling class
@@ -111,7 +111,7 @@
         // $foo[$bar]
         // $foo[5][blah]
         // $foo[5].bar[$foobar][4]
-        $this->_dvar_math_regexp = '[\+\*\/\%]|-(?!>)';
+        $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))';
         $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]';
         $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp
                 . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?';
@@ -148,7 +148,7 @@
         // $foo->bar->foo()
         // $foo->bar->foo->bar()
         $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
-        $this->_obj_params_regexp = '\((?:-?\d|\w+|'
+        $this->_obj_params_regexp = '\((?:(?:' . $this->_num_const_regexp . ')|\w+|'
                 . $this->_var_regexp . '(?:\s*,\s*(?:(?:\w+|'
                 . $this->_var_regexp . ')))*)?\)';
         $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.