create Root node
This commit is contained in:
@@ -2347,7 +2347,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-1 : yypt+1]
|
||||
//line php5/php5.y:272
|
||||
{
|
||||
yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list)
|
||||
yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list)
|
||||
yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list))
|
||||
}
|
||||
case 2:
|
||||
|
||||
@@ -270,7 +270,7 @@ import (
|
||||
start:
|
||||
top_statement_list
|
||||
{
|
||||
yylex.(*Parser).rootNode = stmt.NewStmtList($1)
|
||||
yylex.(*Parser).rootNode = node.NewRoot($1)
|
||||
yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition($1))
|
||||
}
|
||||
;
|
||||
|
||||
@@ -429,7 +429,7 @@ func TestPhp5(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
expected := &stmt.StmtList{
|
||||
expected := &node.Root{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &expr.FunctionCall{
|
||||
@@ -3669,7 +3669,7 @@ func TestPhp5Strings(t *testing.T) {
|
||||
';
|
||||
`
|
||||
|
||||
expected := &stmt.StmtList{
|
||||
expected := &node.Root{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &scalar.String{Value: "\"test\""},
|
||||
@@ -3713,7 +3713,7 @@ CAD;
|
||||
CAD;
|
||||
`
|
||||
|
||||
expected := &stmt.StmtList{
|
||||
expected := &node.Root{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &scalar.Heredoc{
|
||||
|
||||
Reference in New Issue
Block a user