Fix Switch subnode order

Not that it makes much of a difference, but could have caused issues with
"out of order" visiting of nodes.
This commit is contained in:
nikic 2012-10-19 14:54:56 +02:00
parent af5d288fb3
commit 9d8e13b4a9
3 changed files with 8 additions and 8 deletions

View File

@ -16,8 +16,8 @@ class PHPParser_Node_Stmt_Case extends PHPParser_Node_Stmt
public function __construct($cond, array $stmts = array(), array $attributes = array()) { public function __construct($cond, array $stmts = array(), array $attributes = array()) {
parent::__construct( parent::__construct(
array( array(
'stmts' => $stmts,
'cond' => $cond, 'cond' => $cond,
'stmts' => $stmts,
), ),
$attributes $attributes
); );

View File

@ -15,7 +15,7 @@ new $a->b->c();
new $a->b['c'](); new $a->b['c']();
new $a->b{'c'}(); new $a->b{'c'}();
// test regression introduces by new dereferencing syntext // test regression introduces by new dereferencing syntax
(new A); (new A);
----- -----
array( array(

View File

@ -23,23 +23,23 @@ array(
) )
cases: array( cases: array(
0: Stmt_Case( 0: Stmt_Case(
stmts: array(
)
cond: Scalar_LNumber( cond: Scalar_LNumber(
value: 0 value: 0
) )
)
1: Stmt_Case(
stmts: array( stmts: array(
) )
)
1: Stmt_Case(
cond: Scalar_LNumber( cond: Scalar_LNumber(
value: 1 value: 1
) )
)
2: Stmt_Case(
stmts: array( stmts: array(
) )
)
2: Stmt_Case(
cond: null cond: null
stmts: array(
)
) )
) )
) )