Skip to content

Commit 115d481

Browse files
committed
refactoring: update ast structure of "IncludeOnce" node
1 parent 616fd44 commit 115d481

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

internal/php5/parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35182,7 +35182,7 @@ func TestExprInclude_Once(t *testing.T) {
3518235182
StartPos: 3,
3518335183
EndPos: 18,
3518435184
},
35185-
IncludeTkn: &token.Token{
35185+
IncludeOnceTkn: &token.Token{
3518635186
ID: token.T_INCLUDE_ONCE,
3518735187
Value: []byte("include_once"),
3518835188
Position: &position.Position{

internal/php5/php5.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/php5/php5.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,9 +5533,9 @@ internal_functions_in_yacc:
55335533
| T_INCLUDE_ONCE expr
55345534
{
55355535
$$ = &ast.ExprIncludeOnce{
5536-
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
5537-
IncludeTkn: $1,
5538-
Expr: $2,
5536+
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
5537+
IncludeOnceTkn: $1,
5538+
Expr: $2,
55395539
}
55405540
}
55415541
| T_EVAL '(' expr ')'

internal/php7/parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39864,7 +39864,7 @@ func TestExprInclude_Once(t *testing.T) {
3986439864
StartPos: 3,
3986539865
EndPos: 18,
3986639866
},
39867-
IncludeTkn: &token.Token{
39867+
IncludeOnceTkn: &token.Token{
3986839868
ID: token.T_INCLUDE_ONCE,
3986939869
Value: []byte("include_once"),
3987039870
Position: &position.Position{

internal/php7/php7.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/php7/php7.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,9 +4292,9 @@ internal_functions_in_yacc:
42924292
| T_INCLUDE_ONCE expr
42934293
{
42944294
$$ = &ast.ExprIncludeOnce{
4295-
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
4296-
IncludeTkn: $1,
4297-
Expr: $2,
4295+
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
4296+
IncludeOnceTkn: $1,
4297+
Expr: $2,
42984298
}
42994299
}
43004300
| T_EVAL '(' expr ')'

pkg/ast/node.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,9 +1434,9 @@ func (n *ExprInclude) GetPosition() *position.Position {
14341434

14351435
// ExprIncludeOnce node
14361436
type ExprIncludeOnce struct {
1437-
Position *position.Position
1438-
IncludeTkn *token.Token
1439-
Expr Vertex
1437+
Position *position.Position
1438+
IncludeOnceTkn *token.Token
1439+
Expr Vertex
14401440
}
14411441

14421442
func (n *ExprIncludeOnce) Accept(v NodeVisitor) {

pkg/ast/visitor/dumper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ func (v *Dumper) ExprInclude(n *ast.ExprInclude) {
12571257
v.indent++
12581258

12591259
v.dumpPosition(n.Position)
1260-
v.dumpToken("IncludeTkn", n.IncludeTkn)
1260+
v.dumpToken("IncludeOnceTkn", n.IncludeTkn)
12611261
v.dumpVertex("Expr", n.Expr)
12621262

12631263
v.indent--
@@ -1269,7 +1269,7 @@ func (v *Dumper) ExprIncludeOnce(n *ast.ExprIncludeOnce) {
12691269
v.indent++
12701270

12711271
v.dumpPosition(n.Position)
1272-
v.dumpToken("IncludeTkn", n.IncludeTkn)
1272+
v.dumpToken("IncludeOnceTkn", n.IncludeOnceTkn)
12731273
v.dumpVertex("Expr", n.Expr)
12741274

12751275
v.indent--

pkg/ast/visitor/formatter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ func (f *formatter) ExprInclude(n *ast.ExprInclude) {
12581258
}
12591259

12601260
func (f *formatter) ExprIncludeOnce(n *ast.ExprIncludeOnce) {
1261-
n.IncludeTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once"))
1261+
n.IncludeOnceTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once"))
12621262
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
12631263
n.Expr.Accept(f)
12641264
}

pkg/ast/visitor/printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ func (p *printer) ExprInclude(n *ast.ExprInclude) {
745745
}
746746

747747
func (p *printer) ExprIncludeOnce(n *ast.ExprIncludeOnce) {
748-
p.printToken(n.IncludeTkn, []byte("include_once"))
748+
p.printToken(n.IncludeOnceTkn, []byte("include_once"))
749749
p.printNode(n.Expr)
750750
}
751751

0 commit comments

Comments
 (0)