refactoring: update ast structure of "IncludeOnce" node

This commit is contained in:
Vadym Slizov 2020-12-26 22:44:14 +02:00
parent 616fd4448e
commit 115d481a57
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
10 changed files with 15 additions and 15 deletions

View File

@ -35182,7 +35182,7 @@ func TestExprInclude_Once(t *testing.T) {
StartPos: 3, StartPos: 3,
EndPos: 18, EndPos: 18,
}, },
IncludeTkn: &token.Token{ IncludeOnceTkn: &token.Token{
ID: token.T_INCLUDE_ONCE, ID: token.T_INCLUDE_ONCE,
Value: []byte("include_once"), Value: []byte("include_once"),
Position: &position.Position{ Position: &position.Position{

BIN
internal/php5/php5.go generated

Binary file not shown.

View File

@ -5533,9 +5533,9 @@ internal_functions_in_yacc:
| T_INCLUDE_ONCE expr | T_INCLUDE_ONCE expr
{ {
$$ = &ast.ExprIncludeOnce{ $$ = &ast.ExprIncludeOnce{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
IncludeTkn: $1, IncludeOnceTkn: $1,
Expr: $2, Expr: $2,
} }
} }
| T_EVAL '(' expr ')' | T_EVAL '(' expr ')'

View File

@ -39864,7 +39864,7 @@ func TestExprInclude_Once(t *testing.T) {
StartPos: 3, StartPos: 3,
EndPos: 18, EndPos: 18,
}, },
IncludeTkn: &token.Token{ IncludeOnceTkn: &token.Token{
ID: token.T_INCLUDE_ONCE, ID: token.T_INCLUDE_ONCE,
Value: []byte("include_once"), Value: []byte("include_once"),
Position: &position.Position{ Position: &position.Position{

BIN
internal/php7/php7.go generated

Binary file not shown.

View File

@ -4292,9 +4292,9 @@ internal_functions_in_yacc:
| T_INCLUDE_ONCE expr | T_INCLUDE_ONCE expr
{ {
$$ = &ast.ExprIncludeOnce{ $$ = &ast.ExprIncludeOnce{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
IncludeTkn: $1, IncludeOnceTkn: $1,
Expr: $2, Expr: $2,
} }
} }
| T_EVAL '(' expr ')' | T_EVAL '(' expr ')'

View File

@ -1434,9 +1434,9 @@ func (n *ExprInclude) GetPosition() *position.Position {
// ExprIncludeOnce node // ExprIncludeOnce node
type ExprIncludeOnce struct { type ExprIncludeOnce struct {
Position *position.Position Position *position.Position
IncludeTkn *token.Token IncludeOnceTkn *token.Token
Expr Vertex Expr Vertex
} }
func (n *ExprIncludeOnce) Accept(v NodeVisitor) { func (n *ExprIncludeOnce) Accept(v NodeVisitor) {

View File

@ -1257,7 +1257,7 @@ func (v *Dumper) ExprInclude(n *ast.ExprInclude) {
v.indent++ v.indent++
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("IncludeTkn", n.IncludeTkn) v.dumpToken("IncludeOnceTkn", n.IncludeTkn)
v.dumpVertex("Expr", n.Expr) v.dumpVertex("Expr", n.Expr)
v.indent-- v.indent--
@ -1269,7 +1269,7 @@ func (v *Dumper) ExprIncludeOnce(n *ast.ExprIncludeOnce) {
v.indent++ v.indent++
v.dumpPosition(n.Position) v.dumpPosition(n.Position)
v.dumpToken("IncludeTkn", n.IncludeTkn) v.dumpToken("IncludeOnceTkn", n.IncludeOnceTkn)
v.dumpVertex("Expr", n.Expr) v.dumpVertex("Expr", n.Expr)
v.indent-- v.indent--

View File

@ -1258,7 +1258,7 @@ func (f *formatter) ExprInclude(n *ast.ExprInclude) {
} }
func (f *formatter) ExprIncludeOnce(n *ast.ExprIncludeOnce) { 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(" ")) f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.Expr.Accept(f) n.Expr.Accept(f)
} }

View File

@ -745,7 +745,7 @@ func (p *printer) ExprInclude(n *ast.ExprInclude) {
} }
func (p *printer) ExprIncludeOnce(n *ast.ExprIncludeOnce) { 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) p.printNode(n.Expr)
} }