Update of /cvsroot/binaryphp/binaryphp
In directory sc8-pr-cvs1:/tmp/cvs-serv8334
Modified Files:
tokenflow.php
Log Message:
Functions work\!
Index: tokenflow.php
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/tokenflow.php,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** tokenflow.php 9 Aug 2003 03:58:34 -0000 1.53
--- tokenflow.php 9 Aug 2003 05:57:12 -0000 1.54
***************
*** 141,145 ****
case T_ECHO:
++$this->token;
! $this->B_echo($this->Parse_Tokenstream(',', ';'));
break;
case ',':
--- 141,148 ----
case T_ECHO:
++$this->token;
! if($begin == null && $end == null)
! $this->B_echo($this->Parse_Tokenstream(',', ';'), true);
! else
! $code .= $this->B_echo($this->Parse_Tokenstream(',', ';'));
break;
case ',':
***************
*** 154,158 ****
case T_VARIABLE:
if($break == null && $end == null)
! $this->B_Variable($this->Parse_Tokenstream('=', ';'));
else
{
--- 157,166 ----
case T_VARIABLE:
if($break == null && $end == null)
! {
! if($begin == null && $end == null)
! $this->B_variable($this->Parse_Tokenstream('=', ';'), true);
! else
! $code .= $this->B_variable($this->Parse_Tokenstream('=', ';'));
! }
else
{
***************
*** 162,165 ****
--- 170,189 ----
}
break;
+ case T_LNUMBER:
+ case T_DNUMBER:
+ $code .= $data;
+ break;
+ case T_STRING:
+ if($this->tokens[$this->token + 1][0] == '(')
+ {
+ ++$this->token;
+ if($begin == null && $end == null)
+ $this->B_function($data, $this->Parse_Tokenstream(',', ')'), true);
+ else
+ $code .= $this->B_function($data, $this->Parse_Tokenstream(',', ')'));
+ }
+ else
+ $code .= $data;
+ break;
case '-':
case '+':
***************
*** 185,192 ****
*
* @param array $parameters Things to echo.
* @return string
* @access private
*/
! function B_echo($parameters)
{
$this->namespace = 'std';
--- 209,217 ----
*
* @param array $parameters Things to echo.
+ * @param bool $add Set to true to add the code to the source.
* @return string
* @access private
*/
! function B_echo($parameters, $add = false)
{
$this->namespace = 'std';
***************
*** 201,205 ****
}
$code .= ';';
! $this->AddCode($code);
return $code;
}
--- 226,231 ----
}
$code .= ';';
! if($add)
! $this->AddCode($code);
return $code;
}
***************
*** 208,218 ****
*
* @param array $parameters Things to echo.
* @return string
* @access private
*/
! function B_variable($parameters)
{
$code = implode(' = ', $parameters);
! $this->AddCode($code);
return $code;
}
--- 234,263 ----
*
* @param array $parameters Things to echo.
+ * @param bool $add Set to true to add the code to the source.
* @return string
* @access private
*/
! function B_variable($parameters, $add = false)
{
$code = implode(' = ', $parameters);
! if($add)
! $this->AddCode($code);
! return $code;
! }
! /**
! * Code generator for functions
! *
! * @param string $function Name of the function.
! * @param array $parameters Parameters to the function.
! * @param bool $add Set to true to add the code to the source.
! * @return string
! * @access private
! */
! function B_function($function, $parameters, $add = false)
! {
! $code = $function . '(' . implode(', ', $parameters);
! if($add)
! $this->AddCode($code);
! echo 'Bleh?', "\n";
return $code;
}
|