@@ -416,7 +416,7 @@ private static function _init_handle_map() : array {
416416 return null ;
417417 },
418418 '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 );
420420 },
421421 'PhpParser\Node\Expr\FuncCall ' => function (PhpParser \Node \Expr \FuncCall $ n , int $ startLine ) : ast \Node {
422422 return self ::_ast_node_call (
@@ -782,6 +782,14 @@ private static function _init_handle_map() : array {
782782 }
783783 return \count ($ globalNodes ) === 1 ? $ globalNodes [0 ] : $ globalNodes ;
784784 },
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+ },
785793 'PhpParser\Node\Stmt\If_ ' => function (PhpParser \Node \Stmt \If_ $ n , int $ startLine ) : ast \Node {
786794 return self ::_phpparser_if_stmt_to_ast_if_stmt ($ n );
787795 },
@@ -1809,7 +1817,8 @@ private static function _phpparser_list_to_ast_list(PhpParser\Node\Expr\List_ $n
18091817 if ($ item === null ) {
18101818 $ astItems [] = null ;
18111819 } 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 , [
18131822 'value ' => self ::_phpparser_node_to_ast_node ($ item ->value ),
18141823 'key ' => $ item ->key !== null ? self ::_phpparser_node_to_ast_node ($ item ->key ) : null ,
18151824 ], $ item ->getAttribute ('startLine ' ));
@@ -1824,7 +1833,8 @@ private static function _phpparser_array_to_ast_array(PhpParser\Node\Expr\Array_
18241833 if ($ item === null ) {
18251834 $ astItems [] = null ;
18261835 } 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 , [
18281838 'value ' => self ::_phpparser_node_to_ast_node ($ item ->value ),
18291839 'key ' => $ item ->key !== null ? self ::_phpparser_node_to_ast_node ($ item ->key ) : null ,
18301840 ], $ item ->getAttribute ('startLine ' ));
0 commit comments