refactoring: update ast structure of "IncludeOnce" node
This commit is contained in:
parent
616fd4448e
commit
115d481a57
@ -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{
|
||||
|
BIN
internal/php5/php5.go
generated
BIN
internal/php5/php5.go
generated
Binary file not shown.
@ -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 ')'
|
||||
|
@ -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{
|
||||
|
BIN
internal/php7/php7.go
generated
BIN
internal/php7/php7.go
generated
Binary file not shown.
@ -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 ')'
|
||||
|
@ -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) {
|
||||
|
@ -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--
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user