]> granicus.if.org Git - php/commitdiff
require trailing T_NS_SEPARATOR #1005
authorMárcio Almada <marcio3w@gmail.com>
Fri, 30 Jan 2015 22:54:37 +0000 (19:54 -0300)
committerMárcio Almada <marcio3w@gmail.com>
Sat, 7 Mar 2015 20:59:48 +0000 (17:59 -0300)
Zend/tests/ns_088.phpt
Zend/tests/ns_089.phpt
Zend/tests/ns_090.phpt
Zend/tests/ns_091.phpt
Zend/tests/ns_092.phpt
Zend/zend_language_parser.y

index adcc6168224fa4d4387cd519d08812a215cfb4e6..484fae38dfc2fffa649e3b626dce45ae84ed2de6 100644 (file)
@@ -3,7 +3,7 @@ Nested batch use statements syntax error
 --FILE--
 <?php
 namespace Fiz\Biz\Buz {
-    use Foo\Bar\Baz {
+    use Foo\Bar\Baz\{
         A,
         B {
             C
index 52094172d31a160f07120fb2adb6871683565d0a..81c4c02db94b72cd829a747e851411aa0658e1b1 100644 (file)
@@ -14,7 +14,7 @@ namespace Foo\Bar\Baz {
 }
 namespace Fiz\Biz\Buz {
 
-    use Foo\Bar\Baz {
+    use Foo\Bar\Baz\{
         A,
         B,
         C as AC,
index bf460d035237263d529e154c53ed3dfce79acef6..73c859544cd5103e12821380d6884022f0d25441 100644 (file)
@@ -14,8 +14,8 @@ namespace Foo\Bar\Baz {
 }
 namespace Fiz\Biz\Buz {
 
-    use Foo\Bar\Baz { A, B, C as AC, D };
-    use Foo\Bar\Baz { function foo, function bar as buz, const FOO, const BAR AS BOZ };
+    use Foo\Bar\Baz\{ A, B, C as AC, D };
+    use Foo\Bar\Baz\{ function foo, function bar as buz, const FOO, const BAR AS BOZ };
 
     class C { function __construct() {echo __METHOD__,"\n";}}
     function bar(){echo __FUNCTION__,"\n";}
index 2338e88cadebde2ddf28583736059296eec219b0..8d93dd789efefeb378e10ecd858814569c790c48 100644 (file)
@@ -10,7 +10,7 @@ namespace Foo\Bar\Baz {
 }
 namespace Fiz\Biz\Buz {
 
-    use Foo\Bar { A, Baz\B };
+    use Foo\Bar\{ A, Baz\B };
     new A;
     new B;
 }
index aff8c973c52e6bd83097472cd2238e9b628f2a42..c69ada91e235dbc3acb24a2a7f3569abe773f404 100644 (file)
@@ -13,20 +13,20 @@ namespace Foo\Bar {
 }
 namespace Fiz\Biz\Buz {
 
-    use function Foo\Bar {
+    use function Foo\Bar\{
         fiz,
         biz,
         buz as boz,
         A // <- this one must fail
     };
 
-    use const Foo\Bar {
+    use const Foo\Bar\{
         FOO as FOZ,
         BAR,
         B // <- this one must fail
     };
 
-    use Foo\Bar { A, B, const BAR as BOZ };
+    use Foo\Bar\{ A, B, const BAR as BOZ };
 
     function buz(){ echo __FUNCTION__,"\n"; }
     const FOO = 100;
index 88d9e2fa975baefa7b16a4e6660ceae4cc24941d..a9a93b86a696e8aa5c6459b648d2d6a18a3c7e89 100644 (file)
@@ -308,13 +308,13 @@ top_statement:
 ;
 
 batch_use_declarations:
-       namespace_name '{' use_declarations '}'
-               {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $3); }
+       namespace_name T_NS_SEPARATOR '{' use_declarations '}'
+               {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $4); }
 ;
 
 mixed_batch_use_declarations:
-       namespace_name '{' inline_use_declarations '}'
-               {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $3);}
+       namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}'
+               {$$ = zend_ast_create(ZEND_AST_BATCH_USE, $1, $4);}
 ;
 
 inline_use_declarations: