Re: cvs: ZendEngine2 / zend_language_parser.y /tests ns_065.inc ns_065.phpt

Marcus Boerger <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <[email protected]>
Hello Stanislav,

  is there any real need for this besides adding confusion?
To humans this is much more unreadable. Can we please remove this.

marcus

Sunday, June 8, 2008, 11:51:42 AM, you wrote:

> stas            Sun Jun  8 09:51:42 2008 UTC

>   Modified files:              
>     /ZendEngine2        zend_language_parser.y 
>     /ZendEngine2/tests  ns_065.inc ns_065.phpt 
>   Log:
>   MF5: allow aggregating use statements
>   
>   
> http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_parser.y?r1=1.205&r2=1.206&diff_format=u
> Index: ZendEngine2/zend_language_parser.y
> diff -u ZendEngine2/zend_language_parser.y:1.205
> ZendEngine2/zend_language_parser.y:1.206
> --- ZendEngine2/zend_language_parser.y:1.205    Wed May  7 12:04:58 2008
> +++ ZendEngine2/zend_language_parser.y  Sun Jun  8 09:51:42 2008
> @@ -18,7 +18,7 @@
>    
> +----------------------------------------------------------------------+
>  */
>  
> -/* $Id: zend_language_parser.y,v 1.205 2008/05/07 12:04:58 dmitry Exp $ */
> +/* $Id: zend_language_parser.y,v 1.206 2008/06/08 09:51:42 stas Exp $ */
>  
>  /*
>   * LALR shift/reduce conflicts and how they are resolved:
> @@ -174,13 +174,21 @@
>         |       class_declaration_statement             { zend_do_early_binding(TSRMLS_C); }
>         |       T_HALT_COMPILER '(' ')' ';'             {
> zend_do_halt_compiler_register(TSRMLS_C); YYACCEPT; }
>         |       T_NAMESPACE namespace_name ';'  { zend_do_namespace(&$2 TSRMLS_CC); }
> -       |       T_USE namespace_name ';'                {
> zend_do_use(&$2, NULL, 0 TSRMLS_CC); }
> -       |       T_USE namespace_name T_AS T_STRING ';'  {
> zend_do_use(&$2, &$4, 0 TSRMLS_CC); }
> -       |       T_USE T_PAAMAYIM_NEKUDOTAYIM T_STRING ';'              
> { zend_do_use(&$3, NULL, 1 TSRMLS_CC); }
> -       |       T_USE T_PAAMAYIM_NEKUDOTAYIM T_STRING T_AS T_STRING ';' 
> { zend_do_use(&$3, &$5, 1 TSRMLS_CC); }
> +       |       T_USE use_declarations ';'
>         |       constant_declaration ';'
>  ;
>  
> +use_declarations:
> +               use_declarations ',' use_declaration
> +       |       use_declaration
> +
> +use_declaration:
> +               namespace_name                  { zend_do_use(&$1, NULL, 0 TSRMLS_CC); }
> +       |       namespace_name T_AS T_STRING    { zend_do_use(&$1, &$3, 0 TSRMLS_CC); }
> +       |       T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_use(&$2, NULL, 1 TSRMLS_CC); }
> +       |       T_PAAMAYIM_NEKUDOTAYIM T_STRING T_AS T_STRING {
> zend_do_use(&$2, &$4, 1 TSRMLS_CC); }
> +
> +
>  constant_declaration:
>                 constant_declaration ',' T_STRING '=' static_scalar    
> { zend_do_declare_constant(&$3, &$5 TSRMLS_CC); }
>         |       T_CONST T_STRING '=' static_scalar {
> zend_do_declare_constant(&$2, &$4 TSRMLS_CC); }
> http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_065.inc?r1=1.1&r2=1.2&diff_format=u
> Index: ZendEngine2/tests/ns_065.inc
> diff -u /dev/null ZendEngine2/tests/ns_065.inc:1.2
> --- /dev/null   Sun Jun  8 09:51:42 2008
> +++ ZendEngine2/tests/ns_065.inc        Sun Jun  8 09:51:42 2008
> @@ -0,0 +1,9 @@
> +<?php
> +namespace X::Y;
> +function foo() {
> +       echo __FUNCTION__."\n";
> +}
> +namespace X::Z;
> +function foo() {
> +       echo __FUNCTION__."\n";
> +}
> http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_065.phpt?r1=1.1&r2=1.2&diff_format=u
> Index: ZendEngine2/tests/ns_065.phpt
> diff -u /dev/null ZendEngine2/tests/ns_065.phpt:1.2
> --- /dev/null   Sun Jun  8 09:51:42 2008
> +++ ZendEngine2/tests/ns_065.phpt       Sun Jun  8 09:51:42 2008
> @@ -0,0 +1,13 @@
> +--TEST--
> +065: Multiple names in use statement
> +--FILE--
> +<?php
> +use X::Y as test, X::Z as test2;
> +
> +require "ns_065.inc";
> +
> +test::foo();
> +test2::foo();
> +--EXPECT--
> +X::Y::foo
> +X::Z::foo






Best regards,
 Marcus


-- 
Zend Engine 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.