[refactoring] update ast structure of "Eval", "Exit", "FunctionCall", "Include" and "IncludeOnce" nodes
This commit is contained in:
@@ -1074,11 +1074,7 @@ func (p *PrettyPrinter) printExprEval(n ast.Vertex) {
|
||||
func (p *PrettyPrinter) printExprExit(n ast.Vertex) {
|
||||
nn := n.(*ast.ExprExit)
|
||||
|
||||
if nn.Die {
|
||||
io.WriteString(p.w, "die(")
|
||||
} else {
|
||||
io.WriteString(p.w, "exit(")
|
||||
}
|
||||
io.WriteString(p.w, "exit(")
|
||||
p.Print(nn.Expr)
|
||||
io.WriteString(p.w, ")")
|
||||
}
|
||||
@@ -1088,7 +1084,7 @@ func (p *PrettyPrinter) printExprFunctionCall(n ast.Vertex) {
|
||||
|
||||
p.Print(nn.Function)
|
||||
io.WriteString(p.w, "(")
|
||||
p.joinPrint(", ", nn.ArgumentList.Arguments)
|
||||
p.joinPrint(", ", nn.Arguments)
|
||||
io.WriteString(p.w, ")")
|
||||
}
|
||||
|
||||
|
||||
@@ -1590,8 +1590,8 @@ func (p *Printer) printExprExit(n ast.Vertex) {
|
||||
nn := n.(*ast.ExprExit)
|
||||
p.printFreeFloating(nn, token.Start)
|
||||
|
||||
if nn.Die {
|
||||
p.write([]byte("die"))
|
||||
if nn.DieTkn != nil {
|
||||
p.write(nn.DieTkn.Value)
|
||||
} else {
|
||||
p.write([]byte("exit"))
|
||||
}
|
||||
@@ -1611,9 +1611,9 @@ func (p *Printer) printExprFunctionCall(n ast.Vertex) {
|
||||
|
||||
p.Print(nn.Function)
|
||||
|
||||
p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(")
|
||||
p.joinPrint(",", nn.ArgumentList.Arguments)
|
||||
p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")")
|
||||
p.printToken(nn.OpenParenthesisTkn, "(")
|
||||
p.joinPrint(",", nn.Arguments)
|
||||
p.printToken(nn.CloseParenthesisTkn, ")")
|
||||
|
||||
p.printFreeFloating(nn, token.End)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user