From 616fd4448ee4d96dc914698081218c09d6fbd576 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 22:41:25 +0200 Subject: [PATCH] refactoring: rename DieTkn to ExitTkn --- internal/php5/parser_test.go | 12 ++++++------ internal/php5/php5.go | Bin 264709 -> 264710 bytes internal/php5/php5.y | 2 +- internal/php7/parser_test.go | 12 ++++++------ internal/php7/php7.go | Bin 219188 -> 219189 bytes internal/php7/php7.y | 2 +- pkg/ast/node.go | 2 +- pkg/ast/visitor/dumper.go | 2 +- pkg/ast/visitor/formatter.go | 2 +- pkg/ast/visitor/printer.go | 2 +- pkg/ast/visitor/printer_test.go | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) 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 f002d9350497d3cb23729743b41107726741b937..fb7f8dbbb4330434f8362d59d47419ac58ec7ce1 100644 GIT binary patch delta 31 ncmZpjBG5KPprM6v3lrNhCfADT8xJtbx2qjv+OBqt`Mxs%yY37B delta 32 ocmZphBG5WTprM6v3lrNhW|z#=>4mn8((S6pn6|4PV}9ri0K9+;jsO4v 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 64922240c040d010db4ea044bea2c4666176c850..9503f811bf9f1defe6ebb5abd691334b115512e9 100644 GIT binary patch delta 29 lcmdn8fp_Z$-i8*&Eld+vv$$4dmP|i5nNfE8#??&CYXH7t48{Ne delta 28 kcmdnGfp^OW-i8*&Eld+vGrMG_PCq!AQFi;L)lAK60I=l@J^%m! 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{