diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index eeca77d..7cf63ec 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -33219,7 +33219,7 @@ func TestExprExit(t *testing.T) { StartPos: 3, EndPos: 7, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -33299,7 +33299,7 @@ func TestExprExit_Empty(t *testing.T) { StartPos: 3, EndPos: 9, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -33399,7 +33399,7 @@ func TestExprExit_Expr(t *testing.T) { StartPos: 3, EndPos: 11, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -33526,7 +33526,7 @@ func TestExprDie(t *testing.T) { StartPos: 3, EndPos: 6, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ @@ -33606,7 +33606,7 @@ func TestExprDie_Empty(t *testing.T) { StartPos: 3, EndPos: 8, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ @@ -33706,7 +33706,7 @@ func TestExprDie_Expr(t *testing.T) { StartPos: 3, EndPos: 10, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f002d93..fb7f8db 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 6cfbe62..8a66936 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3332,7 +3332,7 @@ expr_without_variable: | T_EXIT exit_expr { exit := &ast.ExprExit{ - DieTkn: $1, + ExitTkn: $1, } if $2 == nil { diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index cd532ff..02bf256 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -37901,7 +37901,7 @@ func TestExprExit(t *testing.T) { StartPos: 3, EndPos: 7, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -37981,7 +37981,7 @@ func TestExprExit_Empty(t *testing.T) { StartPos: 3, EndPos: 9, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -38081,7 +38081,7 @@ func TestExprExit_Expr(t *testing.T) { StartPos: 3, EndPos: 11, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("exit"), Position: &position.Position{ @@ -38208,7 +38208,7 @@ func TestExprDie(t *testing.T) { StartPos: 3, EndPos: 6, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ @@ -38288,7 +38288,7 @@ func TestExprDie_Empty(t *testing.T) { StartPos: 3, EndPos: 8, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ @@ -38388,7 +38388,7 @@ func TestExprDie_Expr(t *testing.T) { StartPos: 3, EndPos: 10, }, - DieTkn: &token.Token{ + ExitTkn: &token.Token{ ID: token.T_EXIT, Value: []byte("die"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 6492224..9503f81 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 9a2cc31..44d8880 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3094,7 +3094,7 @@ expr_without_variable: | T_EXIT exit_expr { exit := &ast.ExprExit{ - DieTkn: $1, + ExitTkn: $1, } if $2 == nil { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index bdc0b75..a3f60d8 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1385,7 +1385,7 @@ func (n *ExprEval) GetPosition() *position.Position { // ExprExit node type ExprExit struct { Position *position.Position - DieTkn *token.Token + ExitTkn *token.Token OpenParenthesisTkn *token.Token Expr Vertex CloseParenthesisTkn *token.Token diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index bb54652..689274d 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1228,7 +1228,7 @@ func (v *Dumper) ExprExit(n *ast.ExprExit) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("DieTkn", n.DieTkn) + v.dumpToken("ExitTkn", n.ExitTkn) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) v.dumpVertex("Expr", n.Expr) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 93c3046..8ce9363 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1230,7 +1230,7 @@ func (f *formatter) ExprEval(n *ast.ExprEval) { } func (f *formatter) ExprExit(n *ast.ExprExit) { - n.DieTkn = f.newToken(token.T_EVAL, []byte("exit")) + n.ExitTkn = f.newToken(token.T_EVAL, []byte("exit")) n.OpenParenthesisTkn = nil n.CloseParenthesisTkn = nil diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index eb96c0e..524c1e8 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -726,7 +726,7 @@ func (p *printer) ExprEval(n *ast.ExprEval) { } func (p *printer) ExprExit(n *ast.ExprExit) { - p.printToken(n.DieTkn, []byte("exit")) + p.printToken(n.ExitTkn, []byte("exit")) p.printToken(n.OpenParenthesisTkn, nil) p.printNode(n.Expr) p.printToken(n.CloseParenthesisTkn, p.ifToken(n.OpenParenthesisTkn, []byte(")"), nil)) diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 44764bb..55b56d6 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -1968,7 +1968,7 @@ func TestPrinterPrintDie(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n := &ast.ExprExit{ - DieTkn: &token.Token{ + ExitTkn: &token.Token{ Value: []byte("die"), }, Expr: &ast.ExprVariable{