@@ -416,7 +416,7 @@ private static function _init_handle_map() : array {
416
416
return null ;
417
417
},
418
418
'PhpParser\Node\Expr\Exit_ ' => function (PhpParser \Node \Expr \Exit_ $ n , int $ startLine ) {
419
- return new ast \Node (ast \AST_EXIT , 0 , ['expr ' => self ::_phpparser_node_to_ast_node ($ n ->expr )], $ startLine );
419
+ return new ast \Node (ast \AST_EXIT , 0 , ['expr ' => $ n -> expr ? self ::_phpparser_node_to_ast_node ($ n ->expr ) : null ], $ startLine );
420
420
},
421
421
'PhpParser\Node\Expr\FuncCall ' => function (PhpParser \Node \Expr \FuncCall $ n , int $ startLine ) : ast \Node {
422
422
return self ::_ast_node_call (
@@ -782,6 +782,14 @@ private static function _init_handle_map() : array {
782
782
}
783
783
return \count ($ globalNodes ) === 1 ? $ globalNodes [0 ] : $ globalNodes ;
784
784
},
785
+ 'PhpParser\Node\Stmt\HaltCompiler ' => function (PhpParser \Node \Stmt \HaltCompiler $ n , int $ startLine ) : ast \Node {
786
+ return new ast \Node (
787
+ \ast \AST_HALT_COMPILER ,
788
+ 0 ,
789
+ ['offset ' => 'TODO compute halt compiler offset ' ], // FIXME implement
790
+ $ startLine
791
+ );
792
+ },
785
793
'PhpParser\Node\Stmt\If_ ' => function (PhpParser \Node \Stmt \If_ $ n , int $ startLine ) : ast \Node {
786
794
return self ::_phpparser_if_stmt_to_ast_if_stmt ($ n );
787
795
},
@@ -1809,7 +1817,8 @@ private static function _phpparser_list_to_ast_list(PhpParser\Node\Expr\List_ $n
1809
1817
if ($ item === null ) {
1810
1818
$ astItems [] = null ;
1811
1819
} else {
1812
- $ astItems [] = new ast \Node (ast \AST_ARRAY_ELEM , 0 , [
1820
+ $ flags = $ item ->byRef ? \ast \flags \PARAM_REF : 0 ;
1821
+ $ astItems [] = new ast \Node (ast \AST_ARRAY_ELEM , $ flags , [
1813
1822
'value ' => self ::_phpparser_node_to_ast_node ($ item ->value ),
1814
1823
'key ' => $ item ->key !== null ? self ::_phpparser_node_to_ast_node ($ item ->key ) : null ,
1815
1824
], $ item ->getAttribute ('startLine ' ));
@@ -1824,7 +1833,8 @@ private static function _phpparser_array_to_ast_array(PhpParser\Node\Expr\Array_
1824
1833
if ($ item === null ) {
1825
1834
$ astItems [] = null ;
1826
1835
} else {
1827
- $ astItems [] = new ast \Node (ast \AST_ARRAY_ELEM , 0 , [
1836
+ $ flags = $ item ->byRef ? \ast \flags \PARAM_REF : 0 ;
1837
+ $ astItems [] = new ast \Node (ast \AST_ARRAY_ELEM , $ flags , [
1828
1838
'value ' => self ::_phpparser_node_to_ast_node ($ item ->value ),
1829
1839
'key ' => $ item ->key !== null ? self ::_phpparser_node_to_ast_node ($ item ->key ) : null ,
1830
1840
], $ item ->getAttribute ('startLine ' ));
0 commit comments