php-parser/pkg/ast/visitor/dump.go

1319 lines
32 KiB
Go
Raw Normal View History

2020-03-12 22:20:48 +00:00
package visitor
import (
"fmt"
"github.com/z7zmey/php-parser/pkg/ast"
"github.com/z7zmey/php-parser/pkg/token"
2020-03-12 22:20:48 +00:00
"io"
"sort"
"strconv"
2020-03-12 22:20:48 +00:00
"strings"
)
type meta struct {
singleNode bool
}
type Dump struct {
writer io.Writer
indent int
depth int
stack []meta
}
func NewDump(writer io.Writer) *Dump {
return &Dump{writer: writer}
}
func (v *Dump) print(str string) {
_, err := io.WriteString(v.writer, str)
if err != nil {
panic(err)
}
}
func (v *Dump) printIndent(indentDepth int) {
if indentDepth < 0 {
indentDepth = 0
}
2020-03-12 22:20:48 +00:00
v.print(strings.Repeat("\t", indentDepth))
}
func (v *Dump) printIndentIfNotSingle(indentDepth int) {
if indentDepth < 0 {
indentDepth = 0
}
2020-03-12 22:20:48 +00:00
if !v.stack[v.depth-1].singleNode {
v.print(strings.Repeat("\t", indentDepth))
}
}
func (v *Dump) Enter(key string, singleNode bool) {
if len(v.stack) < v.depth+1 {
v.stack = append(v.stack, meta{})
}
v.stack[v.depth].singleNode = singleNode
v.printIndent(v.indent)
v.print(key)
v.print(": ")
if !singleNode {
v.print("[]ast.Vertex{\n")
v.indent++
}
}
func (v *Dump) Leave(_ string, singleNode bool) {
if !singleNode {
v.indent--
v.printIndent(v.indent)
v.print("},\n")
}
}
func (v *Dump) EnterNode(n ast.Vertex) bool {
v.indent++
v.depth++
if len(v.stack) < v.depth {
v.stack = append(v.stack, meta{})
}
n.Accept(v)
2020-05-12 21:16:36 +00:00
2020-03-12 22:20:48 +00:00
return true
}
func (v *Dump) LeaveNode(_ ast.Vertex) {
v.indent--
v.depth--
v.printIndent(v.indent)
v.print("}")
if v.depth != 0 {
v.print(",")
}
v.print("\n")
}
func (v *Dump) printNode(n *ast.Node) {
if n.Position == nil && n.Tokens == nil {
return
}
v.printIndent(v.indent)
v.print("Node: ast.Node{\n")
if n.Tokens != nil {
v.printIndent(v.indent + 1)
v.print("Tokens: token.Collection{\n")
keys := make([]int, 0, len(n.Tokens))
for k := range n.Tokens {
keys = append(keys, int(k))
}
sort.Ints(keys)
for _, k := range keys {
key := token.Position(k)
v.printIndent(v.indent + 2)
2020-08-17 17:31:04 +00:00
v.print("token." + key.String() + ": []*token.Token{\n")
for _, tkn := range n.Tokens[key] {
v.printIndent(v.indent + 3)
v.print("{\n")
v.printIndent(v.indent + 4)
v.print("ID: token." + tkn.ID.String() + ",\n")
v.printIndent(v.indent + 4)
v.print("Value: []byte(" + strconv.Quote(string(tkn.Value)) + "),\n")
v.printIndent(v.indent + 3)
v.print("},\n")
}
v.printIndent(v.indent + 2)
v.print("},\n")
}
v.printIndent(v.indent + 1)
v.print("},\n")
}
if n.Position != nil {
v.printIndent(v.indent + 1)
v.print("Position: &position.Position{\n")
v.printIndent(v.indent + 2)
v.print("StartLine: " + strconv.Itoa(n.Position.StartLine) + ",\n")
v.printIndent(v.indent + 2)
v.print("EndLine: " + strconv.Itoa(n.Position.EndLine) + ",\n")
v.printIndent(v.indent + 2)
v.print("StartPos: " + strconv.Itoa(n.Position.StartPos) + ",\n")
v.printIndent(v.indent + 2)
v.print("EndPos: " + strconv.Itoa(n.Position.EndPos) + ",\n")
v.printIndent(v.indent + 1)
v.print("},\n")
}
v.printIndent(v.indent)
v.print("},\n")
}
func (v *Dump) printToken(key string, t *token.Token) {
if t == nil {
return
}
v.printIndent(v.indent)
v.print(key)
v.print(": &token.Token{\n")
v.printIndent(v.indent + 1)
v.print("ID: token." + t.ID.String() + ",\n")
v.printIndent(v.indent + 1)
v.print("Value: []byte(" + strconv.Quote(string(t.Value)) + "),\n")
v.printIndent(v.indent + 1)
v.print("Skipped: []byte(" + strconv.Quote(string(t.Skipped)) + "),\n")
v.printIndent(v.indent)
v.print("},\n")
}
func (v *Dump) Root(n *ast.Root) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Root{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) Nullable(n *ast.Nullable) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Nullable{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) Reference(n *ast.Reference) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Reference{\n")
v.printNode(n.GetNode())
}
func (v *Dump) Variadic(n *ast.Variadic) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Variadic{\n")
v.printNode(n.GetNode())
}
2020-03-12 22:20:48 +00:00
func (v *Dump) Parameter(n *ast.Parameter) {
v.printIndent(v.indent - 1)
v.print("&ast.Parameter{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) Identifier(n *ast.Identifier) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Identifier{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ArgumentList(n *ast.ArgumentList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ArgumentList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) Argument(n *ast.Argument) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.Argument{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.Variadic {
v.printIndent(v.indent)
v.print("Variadic: true,\n")
}
if n.IsReference {
v.printIndent(v.indent)
v.print("IsReference: true,\n")
}
}
func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtAltForeach{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtBreak(n *ast.StmtBreak) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtBreak{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtCase(n *ast.StmtCase) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtCase{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtCatch(n *ast.StmtCatch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtCatch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtClass(n *ast.StmtClass) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtClass{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtClassConstList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtClassExtends{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtClassImplements{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtClassMethod{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.ReturnsRef {
v.printIndent(v.indent)
v.print("ReturnsRef: true,\n")
}
}
func (v *Dump) StmtConstList(n *ast.StmtConstList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtConstList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtConstant(n *ast.StmtConstant) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtConstant{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtContinue(n *ast.StmtContinue) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtContinue{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtDeclare(n *ast.StmtDeclare) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtDeclare{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
}
func (v *Dump) StmtDefault(n *ast.StmtDefault) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtDefault{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtDo(n *ast.StmtDo) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtDo{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtEcho(n *ast.StmtEcho) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtEcho{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtElse(n *ast.StmtElse) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtElse{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtElseIf(n *ast.StmtElseIf) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtElseIf{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtExpression(n *ast.StmtExpression) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtExpression{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtFinally(n *ast.StmtFinally) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtFinally{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtFor(n *ast.StmtFor) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtFor{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtForeach(n *ast.StmtForeach) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtForeach{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtFunction(n *ast.StmtFunction) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtFunction{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.ReturnsRef {
v.printIndent(v.indent)
v.print("ReturnsRef: true,\n")
}
}
func (v *Dump) StmtGlobal(n *ast.StmtGlobal) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtGlobal{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtGoto(n *ast.StmtGoto) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtGoto{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtHaltCompiler{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtIf(n *ast.StmtIf) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtIf{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtInlineHtml{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtInterface(n *ast.StmtInterface) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtInterface{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtInterfaceExtends{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtLabel(n *ast.StmtLabel) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtLabel{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtNamespace(n *ast.StmtNamespace) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtNamespace{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtNop(n *ast.StmtNop) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtNop{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtProperty(n *ast.StmtProperty) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtProperty{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtPropertyList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtReturn(n *ast.StmtReturn) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtReturn{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtStatic(n *ast.StmtStatic) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtStatic{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtStaticVar{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtStmtList(n *ast.StmtStmtList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtStmtList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtSwitch(n *ast.StmtSwitch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtSwitch{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtThrow(n *ast.StmtThrow) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtThrow{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTrait(n *ast.StmtTrait) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTrait{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTraitAdaptationList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTraitMethodRef{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTraitUse{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTraitUseAlias{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTraitUsePrecedence{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtTry(n *ast.StmtTry) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtTry{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtUnset(n *ast.StmtUnset) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtUnset{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtUse(n *ast.StmtUse) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtUse{\n")
v.printNode(n.GetNode())
v.printToken("UseTkn", n.UseTkn)
v.printToken("SemiColonTkn", n.SemiColonTkn)
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtGroupUse{\n")
v.printNode(n.GetNode())
v.printToken("UseTkn", n.UseTkn)
v.printToken("LeadingNsSeparatorTkn", n.LeadingNsSeparatorTkn)
v.printToken("NsSeparatorTkn", n.NsSeparatorTkn)
v.printToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.printToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.printToken("SemiColonTkn", n.SemiColonTkn)
2020-03-12 22:20:48 +00:00
}
func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtUseDeclaration{\n")
v.printNode(n.GetNode())
v.printToken("NsSeparatorTkn", n.NsSeparatorTkn)
v.printToken("AsTkn", n.AsTkn)
v.printToken("CommaTkn", n.CommaTkn)
}
func (v *Dump) StmtWhile(n *ast.StmtWhile) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.StmtWhile{\n")
v.printNode(n.GetNode())
if n.Alt {
v.printIndent(v.indent)
v.print("Alt: true,\n")
}
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprArray(n *ast.ExprArray) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprArray{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprArrayDimFetch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprArrayItem{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.Unpack {
v.printIndent(v.indent)
v.print("Unpack: true,\n")
}
}
func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprArrowFunction{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.ReturnsRef {
v.printIndent(v.indent)
v.print("ReturnsRef: true,\n")
}
if n.Static {
v.printIndent(v.indent)
v.print("Static: true,\n")
}
}
func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBitwiseNot{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBooleanNot{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprClassConstFetch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprClone(n *ast.ExprClone) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprClone{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprClosure(n *ast.ExprClosure) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprClosure{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.ReturnsRef {
v.printIndent(v.indent)
v.print("ReturnsRef: true,\n")
}
if n.Static {
v.printIndent(v.indent)
v.print("Static: true,\n")
}
}
func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprClosureUse{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprConstFetch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprEmpty(n *ast.ExprEmpty) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprEmpty{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprErrorSuppress{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprEval(n *ast.ExprEval) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprEval{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprExit(n *ast.ExprExit) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprExit{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
if n.Die {
v.printIndent(v.indent)
v.print("Die: true,\n")
}
}
func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprFunctionCall{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprInclude(n *ast.ExprInclude) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprInclude{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprIncludeOnce{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprInstanceOf{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprIsset(n *ast.ExprIsset) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprIsset{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprList(n *ast.ExprList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprMethodCall{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprNew(n *ast.ExprNew) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprNew{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPostDec(n *ast.ExprPostDec) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPostDec{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPostInc(n *ast.ExprPostInc) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPostInc{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPreDec(n *ast.ExprPreDec) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPreDec{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPreInc(n *ast.ExprPreInc) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPreInc{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPrint(n *ast.ExprPrint) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPrint{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprPropertyFetch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprReference(n *ast.ExprReference) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprReference{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprRequire(n *ast.ExprRequire) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprRequire{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprRequireOnce{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprShellExec(n *ast.ExprShellExec) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprShellExec{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprShortArray(n *ast.ExprShortArray) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprShortArray{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprShortList(n *ast.ExprShortList) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprShortList{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprStaticCall{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprStaticPropertyFetch{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprTernary(n *ast.ExprTernary) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprTernary{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprUnaryMinus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprUnaryPlus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprVariable(n *ast.ExprVariable) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprVariable{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprYield(n *ast.ExprYield) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprYield{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprYieldFrom{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssign(n *ast.ExprAssign) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssign{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignReference{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignBitwiseAnd{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignBitwiseOr{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignBitwiseXor{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignCoalesce{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignConcat{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignDiv{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignMinus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignMod{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignMul{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignPlus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignPow{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignShiftLeft{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprAssignShiftRight{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryBitwiseAnd{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryBitwiseOr{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryBitwiseXor{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryBooleanAnd{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryBooleanOr{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryCoalesce{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryConcat{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryDiv{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryEqual{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryGreater{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryGreaterOrEqual{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryIdentical{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryLogicalAnd{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryLogicalOr{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryLogicalXor{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryMinus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryMod{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryMul{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryNotEqual{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryNotIdentical{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryPlus{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryPow{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryShiftLeft{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinaryShiftRight{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinarySmaller{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinarySmallerOrEqual{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprBinarySpaceship{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastArray(n *ast.ExprCastArray) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastArray{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastBool(n *ast.ExprCastBool) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastBool{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastDouble{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastInt(n *ast.ExprCastInt) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastInt{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastObject(n *ast.ExprCastObject) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastObject{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastString(n *ast.ExprCastString) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastString{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ExprCastUnset{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarDnumber{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) {
2020-03-12 22:20:48 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarEncapsed{\n")
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarEncapsedStringPart{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarHeredoc{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
2020-03-12 22:20:48 +00:00
v.print(fmt.Sprintf("Label: %q,\n", n.Label))
}
func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarLnumber{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarMagicConstant{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ScalarString(n *ast.ScalarString) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ScalarString{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-03-12 22:20:48 +00:00
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-05-13 18:05:15 +00:00
}
func (v *Dump) NameName(n *ast.NameName) {
2020-05-13 18:05:15 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.NameName{\n")
v.printNode(n.GetNode())
2020-05-13 18:05:15 +00:00
}
func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) {
2020-05-13 18:05:15 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.NameFullyQualified{\n")
v.printNode(n.GetNode())
2020-05-13 18:05:15 +00:00
}
func (v *Dump) NameRelative(n *ast.NameRelative) {
2020-05-13 18:05:15 +00:00
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.NameRelative{\n")
v.printNode(n.GetNode())
2020-05-13 18:05:15 +00:00
}
func (v *Dump) NameNamePart(n *ast.NameNamePart) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.NameNamePart{\n")
2020-07-04 18:22:32 +00:00
v.printNode(n.GetNode())
2020-05-13 18:05:15 +00:00
v.printIndent(v.indent)
v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value))
2020-03-12 22:20:48 +00:00
}
func (v *Dump) ParserAs(n *ast.ParserAs) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ParserAs{\n")
v.printNode(n.GetNode())
}
func (v *Dump) ParserNsSeparator(n *ast.ParserNsSeparator) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ParserNsSeparator{\n")
v.printNode(n.GetNode())
}
func (v *Dump) ParserBrackets(n *ast.ParserBrackets) {
v.printIndentIfNotSingle(v.indent - 1)
v.print("&ast.ParserBrackets{\n")
v.printNode(n.GetNode())
}