#56: now, __halt_compiler(); terminates parsing process
This commit is contained in:
800
php7/php7.go
800
php7/php7.go
File diff suppressed because it is too large
Load Diff
@@ -472,6 +472,8 @@ top_statement:
|
||||
yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken)
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
|
||||
yylex.(*Parser).Begin(scanner.HALT_COMPILER)
|
||||
}
|
||||
| T_NAMESPACE namespace_name ';'
|
||||
{
|
||||
|
||||
@@ -137,7 +137,6 @@ func TestPhp7(t *testing.T) {
|
||||
global $a, $b;
|
||||
a:
|
||||
goto a;
|
||||
__halt_compiler();
|
||||
if ($a) {}
|
||||
if ($a) {} elseif ($b) {}
|
||||
if ($a) {} else {}
|
||||
@@ -379,6 +378,10 @@ func TestPhp7(t *testing.T) {
|
||||
$foo->{$bar[0]};
|
||||
|
||||
[1=>&$a, 2=>list($b)];
|
||||
|
||||
__halt_compiler();
|
||||
|
||||
parsing process must be terminated
|
||||
`
|
||||
|
||||
expectedParams := []node.Node{
|
||||
@@ -1231,7 +1234,6 @@ func TestPhp7(t *testing.T) {
|
||||
&stmt.Goto{
|
||||
Label: &node.Identifier{Value: "a"},
|
||||
},
|
||||
&stmt.HaltCompiler{},
|
||||
&stmt.If{
|
||||
Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
|
||||
@@ -3218,6 +3220,7 @@ func TestPhp7(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
&stmt.HaltCompiler{},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user