cvs: smarty / NEWS /libs Smarty_Compiler.class.php

From: Date: Sat, 19 Apr 2003 10:12:18 +0000
Subject: cvs: smarty / NEWS /libs Smarty_Compiler.class.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-535@lists.php.net to get a copy of this message
messju Sat Apr 19 06:12:18 2003 EDT Modified files: /smarty NEWS /smarty/libs Smarty_Compiler.class.php Log: enabled hex-constants (0x...) as function-attributes, inside if-statements and as modifier-parameters Index: smarty/NEWS diff -u smarty/NEWS:1.342 smarty/NEWS:1.343 --- smarty/NEWS:1.342 Fri Apr 18 06:03:09 2003 +++ smarty/NEWS Sat Apr 19 06:12:18 2003 @@ -1,4 +1,7 @@ - - fixed bug with passing $smarty as reference in Smarty.compiler.class (messju) + - enabled hex-constants (0x...) as function-attributes, inside if-statements + and as modifier-parameters (messju) + - fixed bug with passing $smarty as reference in Smarty.compiler.class + (messju) - corrected output with {strip} and PHP tag newlines (Monte) - added possibility to register function-callbacks as "array(&$obj, 'method)" this affects register_function(), -block, -compiler_function, -modifier, Index: smarty/libs/Smarty_Compiler.class.php diff -u smarty/libs/Smarty_Compiler.class.php:1.211 smarty/libs/Smarty_Compiler.class.php:1.212 --- smarty/libs/Smarty_Compiler.class.php:1.211 Fri Apr 18 06:03:09 2003 +++ smarty/libs/Smarty_Compiler.class.php Sat Apr 19 06:12:18 2003 @@ -39,7 +39,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.211 2003/04/18 10:03:09 messju Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.212 2003/04/19 10:12:18 messju Exp $ */ class Smarty_Compiler extends Smarty { @@ -157,7 +157,7 @@ // |foo:"bar":$foobar // |foo|bar // |foo:$foo->bar - $this->_mod_regexp = '(?:\|@?\w+(?::(?>\w+|' + $this->_mod_regexp = '(?:\|@?\w+(?::(?>-?\w+|' . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; // matches valid function name: @@ -1103,7 +1103,7 @@ preg_match_all('/(?> ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)? | # var or quoted string - \-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@ | # valid non-word token + \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@ | # valid non-word token \b\w+\b | # valid word token \S+ # anything else )/x', $tag_args, $match); @@ -1367,7 +1367,7 @@ $token = 'false'; } else if ($token == 'null') { $token = 'null'; - } else if (preg_match('!^-?[0-9]+$!', $token)) { + } else if (preg_match('!^-?([0-9]+|0[xX][0-9a-fA-F]+)$!', $token)) { /* treat integer literally */ } else if (!preg_match('!^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$!', $token)) { /* treat as a string, double-quote it escaping quotes */

« previous php.smarty.cvs (#535) next »