From b2d29a239080dc4c57b2a444d14257af3b6df12a Mon Sep 17 00:00:00 2001 From: Xavier Noguer Gallego Date: Fri, 11 Nov 2005 14:51:07 +0000 Subject: [PATCH] improving readablity git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@200356 c90b9560-bf6c-de11-be94-00142212c4b1 --- Writer/Parser.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Writer/Parser.php b/Writer/Parser.php index ad2ad66..4402895 100644 --- a/Writer/Parser.php +++ b/Writer/Parser.php @@ -1387,7 +1387,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR if (PEAR::isError($result)) { return $result; } - while (($this->_current_token == SPREADSHEET_EXCEL_WRITER_ADD) || + while (($this->_current_token == SPREADSHEET_EXCEL_WRITER_ADD) or ($this->_current_token == SPREADSHEET_EXCEL_WRITER_SUB)) { if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_ADD) { @@ -1436,7 +1436,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR if (PEAR::isError($result)) { return $result; } - while (($this->_current_token == SPREADSHEET_EXCEL_WRITER_MUL) || + while (($this->_current_token == SPREADSHEET_EXCEL_WRITER_MUL) or ($this->_current_token == SPREADSHEET_EXCEL_WRITER_DIV)) { if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_MUL) @@ -1554,9 +1554,10 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $function = $this->_current_token; $this->_advance(); $this->_advance(); // eat the "(" - while ($this->_current_token != ')') { + while ($this->_current_token != ')') + { if ($num_args > 0) { - if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_COMA || + if ($this->_current_token == SPREADSHEET_EXCEL_WRITER_COMA or $this->_current_token == SPREADSHEET_EXCEL_WRITER_SEMICOLON) { $this->_advance(); // eat the "," or ";" @@ -1664,10 +1665,10 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR $polish .= $converted_tree; } // if it's a function convert it here (so we can set it's arguments) - if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$tree['value']) && - !preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/',$tree['value']) && - !preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/",$tree['value']) && - !is_numeric($tree['value']) && + if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$tree['value']) and + !preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/',$tree['value']) and + !preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/",$tree['value']) and + !is_numeric($tree['value']) and !isset($this->ptg[$tree['value']])) { // left subtree for a function is always an array.