refactoring: rename DieTkn to ExitTkn

This commit is contained in:
Vadym Slizov
2020-12-26 22:41:25 +02:00
parent a593760569
commit 616fd4448e
11 changed files with 21 additions and 21 deletions

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{