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.
@ -5534,7 +5534,7 @@ internal_functions_in_yacc:
|
||||
{
|
||||
$$ = &ast.ExprIncludeOnce{
|
||||
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
|
||||
IncludeTkn: $1,
|
||||
IncludeOnceTkn: $1,
|
||||
Expr: $2,
|
||||
}
|
||||
}
|
||||
|
@ -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.
@ -4293,7 +4293,7 @@ internal_functions_in_yacc:
|
||||
{
|
||||
$$ = &ast.ExprIncludeOnce{
|
||||
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
|
||||
IncludeTkn: $1,
|
||||
IncludeOnceTkn: $1,
|
||||
Expr: $2,
|
||||
}
|
||||
}
|
||||
|
@ -1435,7 +1435,7 @@ func (n *ExprInclude) GetPosition() *position.Position {
|
||||
// ExprIncludeOnce node
|
||||
type ExprIncludeOnce struct {
|
||||
Position *position.Position
|
||||
IncludeTkn *token.Token
|
||||
IncludeOnceTkn *token.Token
|
||||
Expr Vertex
|
||||
}
|
||||
|
||||
|
@ -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