refactoring: rename DieTkn to ExitTkn

This commit is contained in:
Vadym Slizov 2020-12-26 22:41:25 +02:00
parent a593760569
commit 616fd4448e
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
11 changed files with 19 additions and 19 deletions

View File

@ -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{

BIN
internal/php5/php5.go generated

Binary file not shown.

View File

@ -3332,7 +3332,7 @@ expr_without_variable:
| T_EXIT exit_expr
{
exit := &ast.ExprExit{
DieTkn: $1,
ExitTkn: $1,
}
if $2 == nil {

View File

@ -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{

BIN
internal/php7/php7.go generated

Binary file not shown.

View File

@ -3094,7 +3094,7 @@ expr_without_variable:
| T_EXIT exit_expr
{
exit := &ast.ExprExit{
DieTkn: $1,
ExitTkn: $1,
}
if $2 == nil {

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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))

View File

@ -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{