diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 7cf63ec..f4b35d8 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -35182,7 +35182,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 3, EndPos: 18, }, - IncludeTkn: &token.Token{ + IncludeOnceTkn: &token.Token{ ID: token.T_INCLUDE_ONCE, Value: []byte("include_once"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index fb7f8db..09a1930 100644 Binary files a/internal/php5/php5.go and b/internal/php5/php5.go differ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 8a66936..f08fbff 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5533,9 +5533,9 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - IncludeTkn: $1, - Expr: $2, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + IncludeOnceTkn: $1, + Expr: $2, } } | T_EVAL '(' expr ')' diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 02bf256..2854d9a 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -39864,7 +39864,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 3, EndPos: 18, }, - IncludeTkn: &token.Token{ + IncludeOnceTkn: &token.Token{ ID: token.T_INCLUDE_ONCE, Value: []byte("include_once"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 9503f81..2c5e9d0 100644 Binary files a/internal/php7/php7.go and b/internal/php7/php7.go differ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 44d8880..4e44911 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4292,9 +4292,9 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - IncludeTkn: $1, - Expr: $2, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + IncludeOnceTkn: $1, + Expr: $2, } } | T_EVAL '(' expr ')' diff --git a/pkg/ast/node.go b/pkg/ast/node.go index a3f60d8..e85fde6 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1434,9 +1434,9 @@ func (n *ExprInclude) GetPosition() *position.Position { // ExprIncludeOnce node type ExprIncludeOnce struct { - Position *position.Position - IncludeTkn *token.Token - Expr Vertex + Position *position.Position + IncludeOnceTkn *token.Token + Expr Vertex } func (n *ExprIncludeOnce) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 689274d..dc5536d 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1257,7 +1257,7 @@ func (v *Dumper) ExprInclude(n *ast.ExprInclude) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpToken("IncludeOnceTkn", n.IncludeTkn) v.dumpVertex("Expr", n.Expr) v.indent-- @@ -1269,7 +1269,7 @@ func (v *Dumper) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpToken("IncludeOnceTkn", n.IncludeOnceTkn) v.dumpVertex("Expr", n.Expr) v.indent-- diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 8ce9363..3831228 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1258,7 +1258,7 @@ func (f *formatter) ExprInclude(n *ast.ExprInclude) { } func (f *formatter) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - n.IncludeTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once")) + n.IncludeOnceTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.Expr.Accept(f) } diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 524c1e8..22e0cae 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -745,7 +745,7 @@ func (p *printer) ExprInclude(n *ast.ExprInclude) { } func (p *printer) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - p.printToken(n.IncludeTkn, []byte("include_once")) + p.printToken(n.IncludeOnceTkn, []byte("include_once")) p.printNode(n.Expr) }